Wapdesire Prob

Started on the old forum in December 2008 · view the original in the archive · old links redirect here

14 replies · 1,020 views · started 17 years ago · 1 min read

5 participants
darkdesire Senior · 250 posts #1

Im trying to increase the length of the online list moods, ive edited the mood set and DB as needed and its writing the full mood to the database just fine, however for some reason its only displaying the first 38 characters, i dont see anywhere in the coding that limits it to this number... Anyone have any ideas please? CODEelse if($action=="online") { $mmsg = htmlspecialchars(getsetmood(getuid_sid($sid))); addonline(getuid_sid($sid),"Online List ($mmsg)","index.php?action=online"); echo "<head>"; echo "<title>Online List</title>"; echo "<link rel="stylesheet" type="text/css" href="../themes/$theme[0]">"; echo "</head>"; echo "<body>"; //echo "<img src="../images/onlinelist.gif" alt="Online List"/>"; echo popup($sid); //////ALL LISTS SCRIPT <<

if($page=="" || $page<=0)$page=1;
$num_items = getnumonline(); //changable
$items_per_page= 10;
$num_pages = ceil($num_items/$items_per_page);
if($page>$num_pages)$page= $num_pages;
$limit_start = ($page-1)*$items_per_page;

//changable sql
$sql = "SELECT
        a.name,a.perm, b.place, b.userid FROM ibwf_users a
        INNER JOIN ibwf_online b ON a.id = b.userid
        GROUP BY 1,2
        LIMIT $limit_start, $items_per_page
";

echo " "; $items = mysql_query($sql); echo mysql_error(); while ($item = mysql_fetch_array($items)) { if($item[1]=='0') { $tit = "<img src="../images/member.gif" alt=""/>"; }if($item[1]=='1') { $tit = "<img src="../images/moderator.gif" alt=""/>"; }if($item[1]=='2') { $tit = "<img src="../images/admin.gif" alt=""/>"; } if($item[1]=='3') { $tit = "<img src="../images/head.gif" alt=""/>"; } if($item[1]=='4') { $tit = "<img src="../images/owner.gif" alt=""/>"; } if($item[1]=='5') { $tit = "<img src="../images/tech.gif" alt=""/>"; } if($item[1]=='6') { $tit = "<img src="../images/host.gif" alt="*"/>"; }

$sex = mysql_fetch_array(mysql_query("SELECT sex FROM ibwf_users WHERE name='$item[0]'")); if($sex[0]=="M"){$usersex = "<img src="../images/male.gif" alt="(M)"/>";} if($sex[0]=="F"){$usersex = "<img src="../images/female.gif" alt="(F)"/>";} if($sex[0]==""){$usersex = "";} $text = parsepm($item[2], $sid); if($item[1]>'0') { $lnk = "<a href="index.php?action=viewuser&who=$item[3]&sid=$sid">$tit$item[0]$tit $usersex </a> "; }else{ $lnk = "<a href="index.php?action=viewuser&who=$item[3]&sid=$sid">$tit$item[0]$tit $usersex </a> "; }

echo "$lnk $text "; } //echo " "; //echo " "; if($page>1) { $ppage = $page-1; echo "<a href="index.php?action=online&page=$ppage&sid=$sid">«Prev</a> "; } if($page<$num_pages) { $npage = $page+1; echo "<a href="index.php?action=online&page=$npage&sid=$sid">Next»</a>"; } echo " $page/$num_pages"; if($num_pages>2) { echo getjumper($action, $sid,"index"); } echo " ";

CODEfunction getsetmood($uid) { $getdata = mysql_fetch_array(mysql_query("SELECT setmood FROM ibwf_users WHERE id='".$uid."'")); return $getdata[0]; $text = getsmilies($text); }

:p:p:p

crazybrumi Super moderator Principal · 1,064 posts #2

dont use get function

else if($action=="online")
{
$mmsg = htmlspecialchars(getsetmood(getuid_sid($sid)));
addonline(getuid_sid($sid),"Online List ($mmsg)","index.php?action=online");
echo "<head>";
echo "<title>Online List</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
//echo "<div><img src=\"../images/onlinelist.gif\" alt=\"Online List\"/></div>";
echo popup($sid);
//////ALL LISTS SCRIPT <<

if($page=="" || $page<=0)$page=1;
$num_items = getnumonline(); //changable
$items_per_page= 10;
$num_pages = ceil($num_items/$items_per_page);
if($page>$num_pages)$page= $num_pages;
$limit_start = ($page-1)*$items_per_page;

//changable sql
$sql = "SELECT
a.name,a.perm, b.place, b.userid, a.setmood FROM ibwf_users a
INNER JOIN ibwf_online b ON a.id = b.userid
GROUP BY 1,2
LIMIT $limit_start, $items_per_page
";
echo "<p align=\"center\">";
$items = mysql_query($sql);
echo mysql_error();
while ($item = mysql_fetch_array($items))
{
if($item[1]=='0')
{
$tit = "<img src=\"../images/member.gif\" alt=\"*\"/>";
}if($item[1]=='1')
{
$tit = "<img src=\"../images/moderator.gif\" alt=\"*\"/>";
}if($item[1]=='2')
{
$tit = "<img src=\"../images/admin.gif\" alt=\"*\"/>";
} if($item[1]=='3')
{
$tit = "<img src=\"../images/head.gif\" alt=\"*\"/>";
} if($item[1]=='4')
{
$tit = "<img src=\"../images/owner.gif\" alt=\"*\"/>";
} if($item[1]=='5')
{
$tit = "<img src=\"../images/tech.gif\" alt=\"*\"/>";
} if($item[1]=='6')
{
$tit = "<img src=\"../images/host.gif\" alt=\"*\"/>";
}

$sex = mysql_fetch_array(mysql_query("SELECT sex FROM ibwf_users WHERE name='$item[0]'"));
if($sex[0]=="M"){$usersex = "<img src=\"../images/male.gif\" alt=\"(M)\"/>";}
if($sex[0]=="F"){$usersex = "<img src=\"../images/female.gif\" alt=\"(F)\"/>";}
if($sex[0]==""){$usersex = "";}
$mood=$item[2];
if($item[1]>'0')
{
$lnk = "<a href=\"index.php?action=viewuser&who=$item[3]&sid=$sid\">$tit$item[0]$tit
$usersex
</a>
";
}else{
$lnk = "<a href=\"index.php?action=viewuser&who=$item[3]&sid=$sid\">$tit$item[0]$tit
$usersex
</a>
";
}

echo "$lnk $mood 
";
}
//echo "</p>";
//echo "<p align=\"center\">";
if($page>1)
{
$ppage = $page-1;
echo "<a href=\"index.php?action=online&page=$ppage&sid=$sid\">«Prev</a> ";
}
if($page<$num_pages)
{
$npage = $page+1;
echo "<a href=\"index.php?action=online&page=$npage&sid=$sid\">Next»</a>";
}
echo "
$page/$num_pages";
if($num_pages>2)
{
echo getjumper($action, $sid,"index");
}
echo "</p>";

whats the database? and the input form ?

Want something coded email me at sales@webnwaphost.com for a prices.

http://flagcounter.com/more/W80q

darkdesire Senior · 250 posts #3

input form CODEelse if($action=="mood") { echo "<head>"; echo "<title>Set OnlineList Mood</title>"; echo "<link rel="stylesheet" type="text/css" href="../themes/$theme[0]">";

echo "</head>";
echo "<body>";
echo "

"; $mmsg = htmlspecialchars(getsetmood(getuid_sid($sid))); $uid = getuid_sid($sid); echo "<form action="genproc.php?action=upmood&sid=$sid" method="post">"; echo "SET MOOD TO: <input name="mmsg" maxlength="200"/> "; echo "<input type="Submit" name="submit" Value="Submit"></form>"; echo " "; echo " "; echo "<a href="index.php?action=main&sid=$sid"><img src="images/home.gif" alt=""/>Home</a>"; echo " "; echo "</body>"; }

genproc CODEelse if($action=="upmood") { addonline(getuid_sid($sid),"Updating My Mood",""); $mmsg = $_POST["mmsg"];

  echo "<head>";
echo "<title>Set OnlineList Mood</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";

echo "</head>";
echo "<body>";
echo "

"; $res = mysql_query("UPDATE ibwf_users SET setmood='".$mmsg."' WHERE id='".$uid."'"); if($res) { echo "<img src="images/ok.gif" alt="o"/>Mood updated successfully "; }else{ echo "<img src="images/notok.gif" alt="x"/>Can't update your Mood "; } echo "<a href="index.php?action=main&sid=$sid"><img src="images/home.gif" alt=""/>Home</a>"; echo " "; echo "</body>"; }

sql CODE-- Table structure for table ibwf_users

CREATE TABLE IF NOT EXISTS ibwf_users ( id int(100) NOT NULL auto_increment, name varchar(30) NOT NULL default '', pass varchar(60) NOT NULL default '', birthday varchar(50) NOT NULL default '', sex char(1) NOT NULL default '', location varchar(100) NOT NULL default '', perm char(1) NOT NULL default '0', posts int(100) NOT NULL default '0', plusses int(100) NOT NULL default '700', signature varchar(100) NOT NULL default '', avatar varchar(100) NOT NULL default '', email varchar(50) NOT NULL default '', browserm varchar(50) NOT NULL default '', ipadd varchar(30) NOT NULL default '', lastact int(100) NOT NULL default '0', regdate int(100) NOT NULL default '0', chmsgs int(100) NOT NULL default '0', chmood int(100) NOT NULL default '0', shield char(1) NOT NULL default '0', gplus int(100) NOT NULL default '700', budmsg varchar(100) NOT NULL default '', lastpnreas varchar(100) NOT NULL default '', lastplreas varchar(100) NOT NULL default '', shouts int(100) NOT NULL default '0', pollid int(100) NOT NULL default '0', rbcid varchar(255) NOT NULL default '', hvia char(1) NOT NULL default '1', lastvst int(100) NOT NULL default '0', battlep int(100) NOT NULL default '700', popmsg char(1) NOT NULL default '1', automsgs char(1) NOT NULL default '1', validated char(1) NOT NULL default '0', theme varchar(100) NOT NULL default 'white_medium.css', hidden char(1) NOT NULL default '0', quiz_score varchar(20) NOT NULL default '0', quiz_easy char(3) NOT NULL default 'no', quiz_medium char(3) NOT NULL default 'no', quiz_hard char(3) NOT NULL default 'no', total_score varchar(10) NOT NULL default '0', setmood varchar(200) NOT NULL, PRIMARY KEY (id), UNIQUE KEY name (name) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

:p:p:p

something else Fellow · 2,296 posts #4

theres your error

$mmsg = htmlspecialchars(getsetmood(getuid_sid($sid)));

addonline(getuid_sid($sid),"Online List ($mmsg)","index.php?action=online");

your adding the mood into the ibwf_users location sql which aint gonna work 😛

darkdesire Senior · 250 posts #5

my moods are working just fine, i just want them longer

:p:p:p

something else Fellow · 2,296 posts #6

The reason that they are short is because of the reason iv posted above. your trying to put your setmood into your location sql

you could increase your

location varchar(100) NOT NULL default '',

to

location varchar(255) NOT NULL default '',

that would give you a little more space or you could code it a lot better way 😛

darkdesire Senior · 250 posts #7

tried that already, it's set to 200, and it saves all 200 chars when you set mood, it just wont display it all

:p:p:p

inet Senior · 264 posts #8

QUOTE (darkdesire @ Dec 22 2008, 03:20 PM) <{POST_SNAPBACK}>

tried that already, it's set to 200, and it saves all 200 chars when you set mood, it just wont display it all

you want to display only 38 characters? am i right your plan is to show only 38 character out of the 200 characters saved at the sql???????

Services

Are you looking to take your wap or wapsite to a higher level? Do you want to stand out and rise above your competitors?

Below is a list of services I offer:

Wap Design and Customized Coding -The first way to stand out in a crowd is to have a brilliant and unique design for your wap or wapsite.

Rates

General consulting – My current hourly rate is $100 / hour. Custom Wapsite Community - My current rate is $500 / Wap Community Development.

something else Fellow · 2,296 posts #9

you have set your setmoodto 200 character spacing set your locationto 255

**location** varchar(255) NOT NULL default '',

the error you have made why your only getting 38 spaces is because you have got your setmood sql going into your location sql

(this is your coding below----- error is in bold)

$mmsg = htmlspecialchars(getsetmood(getuid_sid($sid)));

addonline(getuid_sid($sid),"Online List ($mmsg)","index.php?action=online");

something else Fellow · 2,296 posts #10

or the better way to sort it out would be to change

$mood=$item[2];

to

$mood = "$item[2] ($item[4])";

and change your

addonline(getuid_sid($sid),"Online List ($mmsg)","index.php?action=online");

back to

addonline(getuid_sid($sid),"Online List ","index.php?action=online");

darkdesire Senior · 250 posts #11

no inet, the problem is that it is only showing 38 characters of the 200 in the database, id like it to show all 200 but this one has beat me lol

:p:p:p

nclemale36 Lead · 537 posts #12

use this instead . saves u loads of coding

//////////////////////////////////////////Update online msg & mood
else if($action=="mood")
{
addonline(getuid_sid($sid),"Updating online msg & mood","");

echo "<head>";
    echo "<title>Online List</title>";
    echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
    echo "</head>";
echo"<body>";
echo "

";

echo "<form action=\"index.php?action=upolm&sid=$sid\" method=\"post\">";
echo "Mood msg: <input name=\"kiss\" maxlength=\"100\"/>
";

echo "<input type=\"Submit\" name=\"submit\" Value=\"Submit\"></form>";

echo "

";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>
";

echo "</p>";
echo "</body>";
}
//////////////////////////////////////////Update online msg & mood
else if($action=="upolm")
{
addonline(getuid_sid($sid),"Updating online msg & mood","");

echo "<head>";
    echo "<title>Online List</title>";
    echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
    echo "</head>";
echo"<body>";
$kiss = $_POST["kiss"];

echo "<p align=\"center\">";
$res = mysql_query("UPDATE ibwf_users SET onlinemsg='".$kiss."' WHERE id='".$uid."'");
  if($res)
  {
    echo "<img src=\"images/ok.gif\" alt=\"o\"/>Your online msg was updated successfully
";
  }else{
    echo "<img src=\"images/notok.gif\" alt=\"x\"/>Error updating your online msg
";
  }
echo "
<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>
";

echo "</p></body>";
}

usage : echo "<a href="index.php?action=mood&sid=$sid">Update Online Mood</a> ";

replace below //changable sql $sql = "SELECT a.name,a.perm, b.place, b.userid,a.onlinemsg FROM ibwf_users a INNER JOIN ibwf_online b ON a.id = b.userid GROUP BY 1,2 LIMIT $limit_start, $items_per_page

in online users function

add row in ibwf_users onlinemsg varchar ??? wotever u want it to be lol .

if i have forgot anything for this am sure u will let me know pmpl .

something else Fellow · 2,296 posts #13

that aint gonna help him as he is not using $item[4] of the sql so if its called setmood or onlinemsg it still isnt going to work

nclemale36 Lead · 537 posts #14

but theres no need to add the htlmchararcters (getsetmood) blah blah blah ) in every page with that .far too much coding using wot u got jamie as i used it to start of with . thats the code i use now . and am sure most others do too

something else Fellow · 2,296 posts #15

yeah thats what im trying to say lol he has coded the long way round and the short way to get more space now is to increase the location charcter settings to 255 otherwize he`s gonna have to go through all his scripts and change his addonline function back to how it was before lol

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