Unable to jump to row 0

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Ghost
    replied
    Originally posted by tzapone View Post
    yes is very good :D but need one more update. If i put wink for example like spam word , and i write .wink. ( to show smiley ) appear .wi*k. If you can fix that is a perfect code.
    you could also try it like this:
    PHP Code:
    $str preg_replace(trim('/^\b'.$spam['text'].'\b$/i'), trim($spam['word']), $str); 
    adding the ^ modifier at start and $ modifier at end could possibly help further
    since it asks to match from the beginning and end exactly. which should then match
    wink Wink WiNk etc but not .wink.

    Leave a comment:


  • tzapone
    replied
    thank you. I will take a break untill next year. I wish you marry christmas and a happy new year :D

    Leave a comment:


  • something else
    replied
    Originally posted by tzapone View Post
    i came with another problem and i hope is the last one:
    i reveceive the error:
    Notice: Undefined index: action in /home/wapcomun/public_html/bere/vinde_pesti.php on line 23 on

    PHP Code:
    $action=htmlspecialchars(trim($_GET['action'])); 
    in this line. I don't know how to define $action.
    PHP Code:
    $action = (isset($_GET['action'])) ? htmlspecialchars(trim($_GET['action'])) : ''

    Leave a comment:


  • tzapone
    replied
    i came with another problem and i hope is the last one:
    PHP Code:
    <?php
    include_once 'sys/inc/start.php';
    include_once 
    'sys/inc/compress.php';
    include_once 
    'sys/inc/sess.php';
    include_once 
    'sys/inc/home.php';
    include_once 
    'sys/inc/settings.php';
    include_once 
    'sys/inc/db_connect.php';
    include_once 
    'sys/inc/ipua.php';
    include_once 
    'sys/inc/fnc.php';
    include_once 
    'sys/inc/user.php';


    $set['title']='Vanzare pestisori'// Ð·Ð°Ð³Ð¾Ð»Ð¾Ð²Ð¾Ðº ÑÑ‚раницы

    include_once 'sys/inc/thead.php';
    title();
    err();
    aut();

    if(isset(
    $user)){
    //if($gconf[0]['open']!=1){

    $action=htmlspecialchars(trim($_GET['action']));


    switch (
    $action){

    default:
    echo 
    "<div class='foot'>";
    echo 
    '1 pestisor = 20 de puncte<br/>';
    echo 
    '</div>';
    echo 
    "<div class='foot'>";
    echo 
    '<img src="/style/icons/fish.png" alt="+"> Ai prins <b>'.$user['extra_ball'].' pestisori</b><br/>';
    echo 
    '</div>';
    echo 
    "<div class='foot'>";
    echo 
    '<img src="/style/icons/many.gif" alt="+"> Ai in cont: <b>'.$user['balls'].'</b> puncte<br/>';
    echo 
    '</div>';
    echo 
    "<div class='p_t'>";
    echo 
    '<form action="vinde_pesti.php?action=change" method="post">';
    echo 
    'Cati pesti vinzi?<br/>';
    echo 
    '<input name="num" type="text" value=""/><br/>';
    echo 
    '<input type="submit" value="Vinde"/>';
    echo 
    '</form>';
    echo 
    '</div>';
    break;

    case 
    'change':
    $num=(int)$_POST['num'];
    if(!
    $num || $num<1){echo 'Nu ai nici un pestisor!';break;};
    if(
    $user['extra_ball']<$num){echo 'Nu ai atati pestisori!';break;};
    $baks=$num*20;
    mysql_query("UPDATE `user` SET `balls`=`balls`+'$baks',`extra_ball`=`extra_ball`-'$num' WHERE `id`='".$user['id']."'");

    echo 
    'Ai vandut cu succes pestisorul!';
    break;


    }
    ;
    //}else{echo '<div class="msg">Jocul este oprit de catre administrator!</div>';};

    }else{
    echo 
    '<div class="msg">Numai utilizatorii autentificati au acces!</div>';
    };
    echo 
    '<div class="foot"><a href="/umenu.php">Meniul meu</a></div>';
    include_once 
    'sys/inc/tfoot.php';
    ?>
    i reveceive the error:
    Notice: Undefined index: action in /home/wapcomun/public_html/bere/vinde_pesti.php on line 23 on

    PHP Code:
    $action=htmlspecialchars(trim($_GET['action'])); 
    in this line. I don't know how to define $action.

    Leave a comment:


  • tzapone
    replied
    thank you all for help

    One more important question i have for you guy. I put on my site VIPMEMBERS activated by time ( 1 day, 2 days etc... ) . Everything is good, but if a member activated for example the option color text, this option will remain after the vip period expires and i don't want that. I try something like this:
    PHP Code:
    $membruvip mysql_result(mysql_query("SELECT COUNT(*) FROM `vipuri` WHERE `id_utilizator` = '$user[id]' AND `time` > '$time'"), 0);
    if (
    $membruvip==0)
    {
    echo 
    " ".output_text($statuse['msg'])." ";
    }else{
    echo 
    "<span style=\"color:$profil[culoaretext]\">";
    echo 
    " ".output_text($statuse['msg'])." ";
    echo 
    "</span>\n";

    but not work very well. If you are not a vip member you can't see any color and if you are a vip member you can see all the color ( even if the user cu vip expires post a message).
    this is the page where you can activate vip member. Maybe you may know how after the vip expires the color text , and color nick set to mod default.
    PHP Code:
    <?
    include_once '../../sys/inc/start.php';
    include_once '../../sys/inc/compress.php';
    include_once '../../sys/inc/sess.php';
    include_once '../../sys/inc/home.php';
    include_once '../../sys/inc/settings.php';
    include_once '../../sys/inc/db_connect.php';
    include_once '../../sys/inc/ipua.php';
    include_once '../../sys/inc/fnc.php';
    include_once '../../sys/inc/adm_check.php';
    include_once '../../sys/inc/user.php';

    $set['title'] = 'Membri vip';
    include_once '../../sys/inc/thead.php';
    title();

    if (!isset($user))
    header("location: /index.php?");

    err();
    aut();

    if (isset($user))
    {
    if (isset($_POST['stav']) && isset($_POST['msg']))
    {
    if ($_POST['stav']==1)
    {
        $st=1;
        $tm=$time+86400;
        $vipstatut=1;
    }
    else if ($_POST['stav']==2)
    {
        $st=2;
        $tm=$time+172800;
        $vipstatut=1;
    }
    else if ($_POST['stav']==3)
    {
        $st=3;
        $tm=$time+259200;
        $vipstatut=1;
    }
    else if ($_POST['stav']==4)
    {
        $st=4;
        $tm=$time+345600;
        $vipstatut=1;
    }
    else if ($_POST['stav']==5)
    {
        $st=5;
        $tm=$time+432000;
        $vipstatut=1;
    }
    else if ($_POST['stav']==6)
    {
        $st=6;
        $tm=$time+518400;
        $vipstatut=1;
    }
    else if ($_POST['stav']==7)
    {
        $st=7;
        $tm=$time+604800;
        $vipstatut=1;
    }


    else if ($_POST['stav']==8)
    {
        $st=30;
        $tm=$time+2592000;
        $vipstatut=1;
    }
    else if ($_POST['stav']==9)
    {
        $st=365;
        $tm=$time+31536000;
        $vipstatut=1;
    }
    $msg=my_esc($_POST['msg']);

    if ($user['money']>=$st)
    {
    if (mysql_result(mysql_query("SELECT COUNT(*) FROM `liders` WHERE `id_user` = '$user[id]'"), 0)==0)
    {
        //mysql_query("INSERT INTO `liders` (`id_user`, `stav`, `msg`, `time`, `time_p`) values('$user[id]', '$st', '".$msg."', '$tm', '$time')");
        mysql_query("INSERT INTO `liders` (`id_user`, `stav`, `msg`, `time`, `time_p`, `vipstatut`) values('$user[id]', '$st', '".$msg."', '$tm', '$time', '$vipstatut')");
        
    }
    else
    {
        //mysql_query("UPDATE `liders` SET `time` = '$tm', `time_p` = '$time', `msg` = '$msg', `stav` = '$st' WHERE `id_user` = '$user[id]'");
        
        mysql_query("UPDATE `liders` SET `time` = '$tm', `time_p` = '$time', `msg` = '$msg', `stav` = '$st', `vipstatut` = '$vipstatut' WHERE `id_user` = '$user[id]'");
    }

    mysql_query("UPDATE `user` SET `money` = '".($user['money']-$st)."' WHERE `id` = '$user[id]' LIMIT 1");

    $_SESSION['message'] = 'Ai devenit cu succes membru vip!!';
    header("Location: /user/liders/index.php?ok");
    exit;

    }else{
    $err='Nu ai suficiente monede pentru a deveni membru vip';
    }
    }else{
    $err='Statusul nu poate fi gol';
    }
    err();

    echo '<div class="foot">';
    echo '<img src="/style/icons/str2.gif" alt="S"/> <a href="/user/money/">Servicii extra</a> | <b>Membru vip</b>';
    echo '</div>';

    echo '<div class="mess">';
    echo 'Pentru a ajunge membru vip trebuie sa ai in cont cel putin <b style="color:red;">1</b> <b style="color:green;"> diamant </b>. Acest serviciu este 
    calculat pe zi, zi in care ne vom asigura ca vei in TOP. Pozitia ta in TOP depinde de numarul de diamante (timpul total de inchiriere)! 
    In plus, profilul tau va putea fi vizibil prin rotatie in sectiunea Dating si Conectati!';
    echo '</div>';

    echo '<form class="main" method="post" action="?">';
        echo '<span style="color: red">Vreau sa fiu vip timp de:</span> <select name="stav">
        <option value="1">1</option>
        <option value="2">2</option>
        <option value="3">3</option>
        <option value="4">4</option>
        <option value="5">5</option>
        <option value="6">6</option>
        <option value="7">7</option>
        <option value="8">30</option>
        <option value="9">365</option>
        </select> zile<br />';
        
    echo 'Status membru vip (100 caractere)<textarea name="msg"></textarea><br />';

    echo '<input value="Fa-ma vip" type="submit" />';
    echo '</form>';
    }


    echo '<div class="foot">';
    echo '<img src="/style/icons/str2.gif" alt="S"/> <a href="/user/money/">Servicii extra</a> | <b>Membru vip</b>';
    echo '</div>';


    include_once '../../sys/inc/tfoot.php';
    ?>
    Added after 6 minutes:

    I think with something like this can be done:

    PHP Code:
    mysql_query("UPDATE `user` SET `color` = '"default"' WHERE `id` = '$user[id]' LIMIT 1"); 
    but i don' know where to put it in this file

    Added after 42 minutes:

    problem solved with:
    PHP Code:
    $membruvip mysql_result(mysql_query("SELECT COUNT(*) FROM `liders` WHERE `id_user` = '$user[id]' AND `time` > '$time'"), 0);
    if (
    $membruvip==0)
    {
    mysql_query("UPDATE `user` SET `mcolor` = '#000000' WHERE `id` = '$user[id]' LIMIT 1");
    mysql_query("UPDATE `user` SET `ncolor` = '#3251FF' WHERE `id` = '$user[id]' LIMIT 1");
    mysql_query("UPDATE `user` SET `ncolor2` = '#3251FF' WHERE `id` = '$user[id]' LIMIT 1");

    in a file that is included in all the site. Somethimes i am so stupid sorry for all my stupid posts.
    Last edited by tzapone; 19.12.13, 11:44.

    Leave a comment:


  • something else
    replied
    Originally posted by tzapone View Post
    i deleted, i try with space at the end, et the beggining. The same, when i write mamamia appear m*m*mia
    exactly you put a space at the start which matched " mama"mia - where as just at the end would have matched lol

    Leave a comment:


  • tzapone
    replied
    Originally posted by Ghost View Post
    you could try using preg_replace instead. using the \b modifier and the i modifier. you can match just the words your looking for exactly. and also upper and lower case char.

    something like:

    PHP Code:
    $str preg_replace(trim('/\b'.$spam['text'].'\b/i'), trim($spam['word']), $str); 
    which should then match mama. Mama. MaMa etc.
    but not match mamamia
    yes is very good :D but need one more update. If i put wink for example like spam word , and i write .wink. ( to show smiley ) appear .wi*k. If you can fix that is a perfect code.

    Leave a comment:


  • Ghost
    replied
    Originally posted by tzapone View Post
    i deleted, i try with space at the end, et the beggining. The same, when i write mamamia appear m*m*mia
    you could try using preg_replace instead. using the \b modifier and the i modifier. you can match just the words your looking for exactly. and also upper and lower case char.

    something like:

    PHP Code:
    $str preg_replace(trim('/\b'.$spam['text'].'\b/i'), trim($spam['word']), $str); 
    which should then match mama. Mama. MaMa etc.
    but not match mamamia

    Leave a comment:


  • tzapone
    replied
    i deleted, i try with space at the end, et the beggining. The same, when i write mamamia appear m*m*mia

    Leave a comment:


  • something else
    replied
    Originally posted by something else View Post
    So why not put it in your spam block as "mama " (with space at end)
    Originally posted by something else View Post
    I would go for:
    PHP Code:
    $str=str_replace($spam['text'],$spam['word'],$str.' '); 
    to avoid breaking any existing string replacements
    These 2 work together correctly - if they are not working for you, then you need to delete the original "mama"

    Leave a comment:


  • tzapone
    replied
    Originally posted by GumSlone View Post
    PHP Code:
    $str=str_replace($spam['text'].' ',$spam['word'],$str); 
    if i put this code the word's appears without cenzure, and the other code appear the same: mama = m*m*

    PHP Code:
    <?
    // 
    // 
    function output_text($str,$br=1,$html=1,$smiles=1,$links=1,$bbcode=1)
    {
        global $theme_ini;
        
    $q1=mysql_query("SELECT * FROM `spam`");
    while ($spam = mysql_fetch_assoc($q1))
    {
    $str=str_ireplace($spam['text'],$spam['sait'],$str);

    }




        //if ($br && isset($theme_ini['text_width']))$str=wordwrap($str, $theme_ini['text_width'], ' ',1);

        if ($html)$str=htmlentities($str, ENT_QUOTES, 'UTF-8'); // 

        if ($links)$str=links($str); //

        if ($smiles)

            $str=smiles($str); // 

        if ($bbcode)
        {
            $tmp_str=$str;
            $str=bbcode($str); // 
        }

        if ($br)
        {
            $str=br($str); // 
        }

        return stripslashes($str); // 
    }


    // 

    function input_value_text($str){return output_text($str,0,1,0,0,0);}

    function rez_text( $text, $maxwords = 15, $maxchar = 100 ){
        $sep=' ';

        $sep2=' &raquo;';

        $words = explode($sep,$text);

        $char = iconv_strlen($text,'utf-8');

        if (count($words) > $maxwords){        $text = join($sep, array_slice($words, 0, $maxwords));
        }

        if ( $char > $maxchar ){
            $text = iconv_substr( $text, 0, $maxchar, 'utf-8' );

        }

        return $text.$sep2;
    }

    function rez_text2( $text, $maxwords = 70, $maxchar = 700 )
    {
    $sep=' ';

    $sep2='';

    $words = explode($sep,$text);

    $char = iconv_strlen($text,'utf-8');

    if (count($words) > $maxwords){
    $text = join($sep, array_slice($words, 0, $maxwords));

    }

    if ( $char > $maxchar ){
    $text = iconv_substr( $text, 0, $maxchar, 'utf-8' );

    }

    return $text.$sep2;

    }

    function rez_text3( $text, $maxwords = 150, $maxchar = 1500 ){
    $sep=' ';

    $sep2='';

    $words = explode($sep,$text);

    $char = iconv_strlen($text,'utf-8');

    if (count($words) > $maxwords){
    $text = join($sep, array_slice($words, 0, $maxwords));

    }

    if ( $char > $maxchar ){
    $text = iconv_substr( $text, 0, $maxchar, 'utf-8' );

    }

    return $text.$sep2;
    }
    ?>
    this is my output text php file

    Leave a comment:


  • something else
    replied
    Originally posted by GumSlone View Post
    PHP Code:
    $str=str_replace($spam['text'].' ',$spam['word'],$str); 
    I would go for:
    PHP Code:
    $str=str_replace($spam['text'],$spam['word'],$str.' '); 
    to avoid breaking any existing string replacements

    Leave a comment:


  • GumSlone
    replied
    PHP Code:
    $str=str_replace($spam['text'].' ',$spam['word'],$str); 

    Leave a comment:


  • tzapone
    replied
    if i put with space end the word mama appear mama :P without censure

    Leave a comment:


  • something else
    replied
    So why not put it in your spam block as "mama " (with space at end)

    Leave a comment:

Working...
X