need help to complete my color button

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

6 replies · 444 views · started 17 years ago · 1 min read

2 participants
mr_lash Junior · 21 posts #1

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 ""; echo "<body>";

echo " "; $whonick = getnick_uid($who); echo "Send Inbox to $whonick

"; echo "<form action="inbxproc.php?action=sendpm&who=$who&sid=$sid" method="post"> "; echo "<input name="pmtext" maxlength="500"/> "; 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(.*?)","\1", $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;(

something else Fellow · 2,296 posts #2

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

mr_lash Junior · 21 posts #3

ok here a bit from inboxproc.php

$text=preg_replace("/\green","\1", $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

something else Fellow · 2,296 posts #4

without having to put another field in your database the answer would be on inboxproc.php have:

$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."'");

🙂

mr_lash Junior · 21 posts #5

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

test

so no color yet lol;(

mr_lash Junior · 21 posts #6

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

ttttttttttttttttttttttttttttt

something else Fellow · 2,296 posts #7

oops yeah doh! lol change it to:

$color = $_POST["color"]; $pmtext = "$pmtext"; $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]/Usi", "\2", $text);

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