Smilies limit in the post

Started on the old forum in July 2009 · view the original in the archive · old links redirect here

21 replies · 1,323 views · started 17 years ago · 2 min read

9 participants
srecnica Developer · 174 posts #1

How to restrict to the post in the topic, only type 2 Smile? I am tried with this function, which is in the [ if (nose>2) ]in chat.php, but not work 🙁..Is there any idea how to do this? Here's how I tried ..

else if($action=="post") { if (istrashed(getuid_sid($sid))){

echo "<card id="main" title="HAPPY">"; echo " "; echo "Blokada pisanja od strane moderatora!

"; echo "<a href="index.php?action=main&sid=$sid">HAPPY</a>"; echo " "; echo "</card>"; echo "</wml>"; exit();

}

$tid = $_POST["tid"];
$tfid = mysql_fetch_array(mysql_query("SELECT fid FROM ibwf_topics WHERE id='".$tid."'"));

if(!canaccess(getuid_sid($sid), $tfid[0])) { echo "<card id="main" title="HAPPY">"; echo " "; echo "Nemate saglasnost da vidite ovaj Forum!

"; echo "<a href="index.php?action=main&sid=$sid">HAPPY</a>"; echo " "; echo "</card>"; echo "</wml>"; exit(); } $reptxt = $_POST["reptxt"]; $qut = $_POST["qut"]; addonline(getuid_sid($sid),"Replika",""); echo "<card id="main" title="HAPPY Forum">"; echo " "; $crdate = time(); $fid = getfid($tid); //$uid = getuid_sid($sid); $res = false; $closed = mysql_fetch_array(mysql_query("SELECT closed FROM ibwf_topics WHERE id='".$tid."'")); $postinfo = $reptxt; $number = strlen($postinfo);

  if(($closed[0]!='1')||(ismod($uid)))
  {
  
    $lpost = mysql_fetch_array(mysql_query("SELECT dtpost FROM ibwf_posts WHERE uid='".$uid."' ORDER BY dtpost DESC LIMIT 1"));
    global $post_af;
    $antiflood = time()-$lpost[0];
    if($antiflood>$post_af)

{ if(trim($reptxt)!="") { $res = mysql_query("INSERT INTO ibwf_posts SET text='".$reptxt."', tid='".$tid."', uid='".$uid."', dtpost='".$crdate."', quote='".$qut."'"); }

  if($res)
  {

if($nos>2){

    $usts = mysql_fetch_array(mysql_query("SELECT posts, plusses FROM ibwf_users WHERE id='".$uid."'"));
    $ups = $usts[0]+1;
    $upl = $usts[1]+1;
    mysql_query("UPDATE ibwf_users SET posts='".$ups."', plusses='".$upl."' WHERE id='".$uid."'");
    mysql_query("UPDATE ibwf_topics SET lastpost='".$crdate."' WHERE id='".$tid."'");

$unop = mysql_fetch_array(mysql_query("SELECT posts FROM ibwf_users WHERE id='".$uid."'"));

$chs = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline")); echo " <a href="chat.php?rid=100&sid=$sid">HAPPY KVIZ</a>($chs[0])

";

echo "Prisutni su : <a href="index.php?action=online&sid=$sid">".getnumonline()."</a> ";

    echo "<img src=\"http://coding-talk.com/images/ok.gif\" alt=\"O\"/> 

Uspešno ste upisali vaš $unop[0]. Komentar"; echo "

<a href="index.php?action=viewtpc&sid=$sid&tid=$tid&go=last">"; echo "Pogledaj temu</a>"; else{ $nos = substr_count($text,"External image (may be gone) Forum sistem: Dozvoljeno je samo 2 smajlija po poruci"; }

}else{ echo "<img src="http://coding-talk.com/images/notok.gif" alt="X"/>Nemoguce postovati poruku!"; } }

else{ $af = $post_af -$antiflood; echo "<img src="http://coding-talk.com/images/notok.gif" alt="X"/>Antiflood Kontrola: $af"; } } else{ echo "<img src="http://coding-talk.com/images/notok.gif" alt="X"/>Tema zatvorena za pisanje!"; }

  $fname = getfname($fid);
  echo "

<a href="index.php?action=viewfrm&sid=$sid&fid=$fid">"; echo "$fname</a> "; echo "<a href="index.php?action=main&sid=$sid"><img src="http://coding-talk.com/images/home.gif" alt="*"/>"; echo "HAPPY</a>"; echo " "; echo "</card>";

}

something else Fellow · 2,296 posts #2
else if($action=="post")
{
if (istrashed(getuid_sid($sid))){

echo "<card id=\"main\" title=\"HAPPY\">";
echo "<p align=\"center\">";
echo "Blokada pisanja od strane moderatora!<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\">HAPPY</a>";
echo "</p>";
echo "</card>";
echo "</wml>";
exit();

}

$tid = $_POST["tid"];
$tfid = mysql_fetch_array(mysql_query("SELECT fid FROM ibwf_topics WHERE id='".$tid."'"));
if(!canaccess(getuid_sid($sid), $tfid[0]))
{
echo "<card id=\"main\" title=\"HAPPY\">";
echo "<p align=\"center\">";
echo "Nemate saglasnost da vidite ovaj Forum!<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\">HAPPY</a>";
echo "</p>";
echo "</card>";
echo "</wml>";
exit();
}
$reptxt = $_POST["reptxt"];
$qut = $_POST["qut"];
addonline(getuid_sid($sid),"<b>Replika</b>","");
echo "<card id=\"main\" title=\"HAPPY Forum\">";
echo "<p align=\"center\">";
$crdate = time();
$fid = getfid($tid);
//$uid = getuid_sid($sid);
$res = false;
$closed = mysql_fetch_array(mysql_query("SELECT closed FROM ibwf_topics WHERE id='".$tid."'"));
$postinfo = $reptxt;
$number = strlen($postinfo);

if(($closed[0]!='1')||(ismod($uid)))
{

$lpost = mysql_fetch_array(mysql_query("SELECT dtpost FROM ibwf_posts WHERE uid='".$uid."' ORDER BY dtpost DESC LIMIT 1"));
global $post_af;
$antiflood = time()-$lpost[0];
if($antiflood>$post_af)
{
if(trim($reptxt)!="")
{

$nos = substr_count($reptxt,"<img src=");
if($nos>2){
echo "<img src=\"http://coding-talk.com/images/notok.gif\" alt=\"X\"/><b> Forum sistem: Dozvoljeno je samo 2 smajlija po poruci</b>";
}else{
$res = mysql_query("INSERT INTO ibwf_posts SET text='".$reptxt."', tid='".$tid."', uid='".$uid."', dtpost='".$crdate."', quote='".$qut."'");
}
}
if($res)
{

$usts = mysql_fetch_array(mysql_query("SELECT posts, plusses FROM ibwf_users WHERE id='".$uid."'"));
$ups = $usts[0]+1;
$upl = $usts[1]+1;
mysql_query("UPDATE ibwf_users SET posts='".$ups."', plusses='".$upl."' WHERE id='".$uid."'");
mysql_query("UPDATE ibwf_topics SET lastpost='".$crdate."' WHERE id='".$tid."'");

$unop = mysql_fetch_array(mysql_query("SELECT posts FROM ibwf_users WHERE id='".$uid."'"));

$chs = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline"));
echo " <center> <a href=\"chat.php?rid=100&sid=$sid\">HAPPY KVIZ</a>($chs[0])<br/><br/></center>";

echo "Prisutni su : <a href=\"index.php?action=online&sid=$sid\">".ge tnumonline()."</a><br/>";

echo "<img src=\"http://coding-talk.com/images/ok.gif\" alt=\"O\"/> <br/>Uspešno ste upisali vaš <b>$unop[0]</b>. Komentar";
echo "<br/><br/><a href=\"index.php?action=viewtpc&sid=$sid&t id=$tid&go=last\">";
echo "Pogledaj temu</a>";

}else{
echo "<img src=\"http://coding-talk.com/images/notok.gif\" alt=\"X\"/>Nemoguce postovati poruku!";
}
}

else{
$af = $post_af -$antiflood;
echo "<img src=\"http://coding-talk.com/images/notok.gif\" alt=\"X\"/>Antiflood Kontrola: $af";
}
}
else{
echo "<img src=\"http://coding-talk.com/images/notok.gif\" alt=\"X\"/>Tema zatvorena za pisanje!";
}

$fname = getfname($fid);
echo "<br/><br/><a href=\"index.php?action=viewfrm&sid=$sid&f id=$fid\">";
echo "$fname</a><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"http://coding-talk.com/images/home.gif\" alt=\"*\"/>";
echo "HAPPY</a>";
echo "</p>";
echo "</card>";

}

something like this lol

i0nutzxp Developer · 150 posts #5
$postxt = parsepm($reptxt,$sid);  
$nrom = substr_count($postxt,"<img src=");
    if($nrom>2){
      echo "<small>";
echo "Only two smilies per post!<br/><br/>";
echo "<a href=\"index.php?action=forum&sid=$sid\">Forum</a><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
echo "</small></p>";
echo "</card>";
echo "</wml>";
exit();
    }

❗

<?php unlink('World/Europe/Romania.country'); ?>
i0nutzxp Developer · 150 posts #8

rukiya wrote: Taken form chat.php

yes but thei forget to transform the smiley code into image else no <img src= in the text msg ..... 😌

<?php unlink('World/Europe/Romania.country'); ?>
mazalo Developer · 50 posts #9

i0nutzxp wrote:

$postxt = parsepm($reptxt,$sid);  
$nrom = substr_count($postxt,"<img src=");
    if($nrom>2){
      echo "<small>";
echo "Only two smilies per post!<br/><br/>";
echo "<a href=\"index.php?action=forum&sid=$sid\">Forum</a><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
echo "</small></p>";
echo "</card>";
echo "</wml>";
exit();
    }

❗

Don't work shouts.... What's wrong?

$postxt = parsepm($reptxt,$sid);
$nrom = substr_count($postxt,"<img src=");

shad0w Developer · 119 posts #10

Can be that hard to take a code from chat.php ? It is something like:

if ($nosm>2)
{
echo "You can use max. 2 smilies";
}else{
POST CODE
}

Is so hard to do that?? If it is, post your $action=post and I will mod it for you 😀

whatmp3.name - search mp3 on mobile

i0nutzxp Developer · 150 posts #12

mazalo wrote: Don't work shouts.... What's wrong?

change $reptxt whit $shtxt

<?php unlink('World/Europe/Romania.country'); ?>
srecnica Developer · 174 posts #14

$shtxt = parsepm($shtxt,$sid);
$nrom = substr_count($shtxt,"External image (may be gone)"; echo " ";

  echo "";

echo "Forum system:»Allowed only one Smiley ";

echo "<a href="index.php?action=main&sid=$sid"><img src="http://coding-talk.com/images/home.gif" alt="*"/>"; echo "HAPPY</a>"; echo " "; echo "</card>"; echo "</wml>"; exit(); }

change >>> $postxt = parsepm($reptxt,$sid);
$nrom = substr_count($postxt,"<img src="); <<< with >>>$shtxt = parsepm($shtxt,$sid);
$nrom = substr_count($shtxt,"<img src=");

Guest #17

i need somethnig different - when someone type more than 1 smile ,that first smile convert to image,not others!

For example: Hello 🙂 i need help 😀 bla bla .. 😛 ------> 🙂 - image , 😀 - text , 😛 - text

How to do that? 😀

Guest #18

This is very important and urgent,please help me 😀 i have function who make that from file where codes for smiles,but how to do that from SQL?

Guest #19

evo na srpskom,treba mi kad neko napishe poruku u kojoj se nalazi vishe kodova za smajlice,da se uvek u toj poruci samo prvi kod pretvori u slichicu a ostali ne. Kapiras sad? Znachi da nema nikakvih opomena ako se napise vise od 2 smajlica kao sto si ti htela,nego da se jednostavno u vek u poruci ucita samo prvi smajlic,ostali da ostanu kodovi.

On english: When smenone type message with text and more than one code for smile,that in this message always first code transform to smile ,others codes stay in text.

I give example: Hello 🙂 this message is example 😛 in this message i type 4 codes for smiles 😀 but i need that always fisrt code be smile,othars codes stay text xD

User will see in this message 🙂 - image (code is transform to smile) 😛 - text (stay code,no transformation) 😀 -text (stay code,no transformation) xD - text (stay code,no transformation)

Sorry for bad english 😀

metulj Super moderator Principal · 1,726 posts #20

ENGLISH on forums !! if everyone will start to use his own language... we will have bloody chaos

else.. use inbox❗

It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt. ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ ! ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.

キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close