need help to complete my color button

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

    need help to complete my color button

    in inbox.php i added this
    if($action=="sendpm")
    {
    addonline(getuid_sid($sid),"Sending Inbox","inbox.php?action=$action");
    echo "<head>";
    echo "<title>Inbox</title>";
    echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
    echo "</head>";
    echo "<b>";
    echo "<body>";

    echo "<p align=\"center\">";
    $whonick = getnick_uid($who);
    echo "Send Inbox to $whonick<br/><br/>";
    echo "<form action=\"inbxproc.php?action=sendpm&amp;who=$who&a mp;sid=$sid\" method=\"post\"><p align=\"center\">";
    echo "<input name=\"pmtext\" maxlength=\"500\"/><br/>";
    echo "<select name=\"color\">\n";
    echo "<option value=\"white\">White</option>\n";
    echo "<option value=\"blue\">Blue</option>\n";
    echo "<option value=\"lime\">Lime</option>\n";
    echo "<option value=\"yellow\">Yellow</option>\n";
    echo "<option value=\"grey\">Grey</option>\n";
    echo "<option value=\"white\">White</option>\n";
    echo "<option value=\"silver\">Silver</option>\n";
    echo "<option value=\"orange\">Orange</option>\n";
    echo "<option value=\"red\">Red</option>\n";
    echo "<option value=\"magenta\">Magenta</option>\n";
    echo "<option value=\"cyan\">Cyan</option>\n";
    echo "<option value=\"pink\">Pink</option>\n";
    echo "<option value=\"purple\">Purple</option>\n";
    echo "</select>\n";

    in core.php i added this
    function getbrum($text)
    $pmtext = htmlspecialchars($pmtext);
    $pmtext=preg_replace("/\lime(.*?)","<font color=\"lime\">\\1</font>", $pmtext);
    and so on with all my other colors!
    when reading the inbox,,,,color doesnt change! what am i not seeing here? lol anyone can help me pls n thx

    #2
    We cant tell you whats wrong if you dont show full code.
    need to see your inbxproc.php?action=sendpm

    Comment


      #3
      ok here a bit from inboxproc.php

      $text=preg_replace("/\green","<font color=\"green\">\\1</font>", $text);
      $res = mysql_query("INSERT INTO ibwf_private SET text='".$pmtext."', byuid='".$byuid."', touid='".$who."', timesent='".$tm."'");

      this should send text in green,,,but it doesnt
      even when u do delect green

      Comment


        #4
        without having to put another field in your database the answer would be on inboxproc.php have:
        Code:
        $color = $_POST["color"];
        $pmtext = "<font color=\"$color\">$pmtext</font>";
        $res = mysql_query("INSERT INTO ibwf_private SET text='".$pmtext."', byuid='".$byuid."', touid='".$who."', timesent='".$tm."'");
        Last edited by something else; 27.08.09, 03:46.

        Comment


          #5
          ok i added the above code in inboxproc.php
          now when choosing the color lime! the inbox received was:

          <font color="lime">test</font>

          so no color yet lol

          Comment


            #6
            i did minor changes but still the inbox comes out like this:
            Inbox By: +Mr_Lash
            27 08 2009 - 08:45:15

            <font color="orange">ttttttttttttttttttttttttttttt</font>

            Comment


              #7
              oops yeah doh! lol change it to:

              $color = $_POST["color"];
              $pmtext = "[color=$color]$pmtext[/color]";
              $res = mysql_query("INSERT INTO ibwf_private SET text='".$pmtext."', byuid='".$byuid."', touid='".$who."', timesent='".$tm."'");



              and in core.php in bbcodes add
              $text = preg_replace("/\[color=(.*)\](.*)\[\/color\]/Usi", "<font colour=\"\\1\">\\2</font>", $text);

              Comment

              Working...
              X