Conected List Modificated On Lavalai Chat

Started on the old forum in May 2007 · view the original in the archive · old links redirect here

26 replies · 1,683 views · started 19 years ago · 1 min read

TL;DR · summary of 26 replies
  • matthew26 could not find the online list action in index.php.
  • wolf77ar provided a solution to add images based on user sex, but matthew26's code did not work as expected due to missing ampersands.
  • matthew26 replaced the code with suggested corrections and now it works correctly.
  • The issue was resolved by removing some extra ampersands in the HTML links.

Written automatically from the replies by a language model on our own server. It can be wrong; the posts below are the source.

5 participants
a13x #1

Help pls.

a13x #2

i want to put in users online list some images,if is a male to have a male's image,and if is a female to have a female image.can some1 help me with this plsss

a13x #3

do u understand what i want 2 do??in users conected list to put sme imges,each sex's have one,if is a male-male image and female-female imge

wolf77ar Developer · 51 posts #4

do u understand what i want 2 do??in users conected list to put sme imges,each sex's have one,if is a male-male image and female-female imge

In index.php, actions=online list change whith this: echo "

";

$items = mysql_query($sql);
echo mysql_error();
while ($item = mysql_fetch_array($items))
{

$nopl = mysql_fetch_array(mysql_query("SELECT sex FROM ibwf_users WHERE id='".$item[2]."'"));

$uage = getage($nopl[1]); if($nopl[0]=='M') { $usex = "<img src="images/male.gif" alt="male"/>"; }else if($nopl[0]=='F'){ $usex = "<img src="images/female.gif" alt="female"/>"; }else{ $usex = "<img src="images/point.gif" alt="?"/>"; } $nopl[2] = htmlspecialchars($nopl[2]); $lnk = "<a href="index.php?action=viewuser&who=$item[2]&sid=$sid">$item[0]</a>"; echo "$usex $lnk - $item[1] "; } echo " ";

echo "<a href="http://wapcomunity.ro">[-Enter Here-]</a>";

matthew26 Developer · 165 posts #6

i cant find online list in index.php where is it

** visit my new forum wapsite on your mobile phone today.  wapfire.freehostia.com **

matthew26 Developer · 165 posts #8

please post what where it is i cant find it

** visit my new forum wapsite on your mobile phone today.  wapfire.freehostia.com **

matthew26 Developer · 165 posts #9

External image (may be gone) heres my index file please can you add the code where it goes and upload it cos i cant find it

** visit my new forum wapsite on your mobile phone today.  wapfire.freehostia.com **

Attachments: index.php
matthew26 Developer · 165 posts #10

please help plzzzzzzzzz

** visit my new forum wapsite on your mobile phone today.  wapfire.freehostia.com **

a13x #11

mathew is not so dificil ,search in index.php this action: else if($action=="online") and in the rest is simple

matthew26 Developer · 165 posts #12

im looking but cant find it

** visit my new forum wapsite on your mobile phone today.  wapfire.freehostia.com **

matthew26 Developer · 165 posts #13

is this it if it is where do i put the code?

//////////////////////////////////ONLINE USERS
else if($action=="newtopic")
{
  $fid = $_GET["fid"];
  if(!canaccess(getuid_sid($sid), $fid))
    {
        echo "<card id=\"main\" title=\"harderstyles.net\">";
      echo "<p align=\"center\">";
      echo "You Don't Have A Permission To View The Contents Of This Forum

";
      echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
      echo "</p>";
      echo "</card>";
      echo "</wml>";
      exit();
    }
    addonline(getuid_sid($sid),"Creating new topic","index.php?action=online");
    echo "<card id=\"main\" title=\"New Topic\">";
    echo "<p align=\"center\">";
    echo "Title:<input name=\"ntitle\" maxlength=\"30\"/>
";
    echo "Text:<input name=\"tpctxt\" maxlength=\"500\"/>
";
    echo "<anchor>Create";
    echo "
         <go href=\"genproc.php?action=newtopic&sid=$sid\" method=\"post\">
         <postfield name=\"fid\" value=\"$fid\"/>
         <postfield name=\"ntitle\" value=\"$(ntitle)\"/>
         <postfield name=\"tpctxt\" value=\"$(tpctxt)\"/>
         </go>
            ";
            echo "</anchor>";
    echo "

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

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

** visit my new forum wapsite on your mobile phone today.  wapfire.freehostia.com **

matthew26 Developer · 165 posts #14

actually is it this but where to put the code can some add the code to this thanks

//////////////////////////////////////////Guestbook

else if($action=="signgb")
{
$who=$_GET["who"];
addonline(getuid_sid($sid),"Signing a guestbook","");
if(!cansigngb(getuid_sid($sid), $who))
    {
        echo "<card id=\"main\" title=\"futurewap\">";
      echo "<p align=\"center\">";
      echo "You cant Sign this user guestbook

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

    echo "<card id=\"main\" title=\"Sign Guestbook\">";
    echo "<onevent type=\"onenterforward\">";
  echo "<refresh>
        <setvar name=\"msgtxt\" value=\"\"/>
        
   ";
  echo "</refresh></onevent>";

    echo "<p align=\"center\">";
    echo "Text:<input name=\"msgtxt\" maxlength=\"500\"/>
";
    echo "<anchor>Add";
    echo "
         <go href=\"genproc.php?action=signgb&sid=$sid\" method=\"post\">
         
         <postfield name=\"msgtxt\" value=\"$(msgtxt)\"/>
        <postfield name=\"who\" value=\"$who\"/>
         </go>
            ";
            echo "</anchor>";

         echo "

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

else if($action=="online")
{

  addonline(getuid_sid($sid),"Online List","");
    echo "<card id=\"main\" title=\"ONLINE\">";

  //////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, 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 "

[size="1"]";
    $items = mysql_query($sql);
    echo mysql_error();
    while ($item = mysql_fetch_array($items))
    {
      $lnk = "<a href=\"index.php?action=viewuser&who=$item[2]&sid=$sid\">$item[0]</a>";
      echo "$lnk - $item[1] 
";
    }
    echo "[/size]</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>";

** visit my new forum wapsite on your mobile phone today.  wapfire.freehostia.com **

matthew26 Developer · 165 posts #16

is this it can you add the code to this else if($action=="online")

else if($action=="online")
{

  addonline(getuid_sid($sid),"Online List","");
    echo "<card id=\"main\" title=\"ONLINE\">";

  //////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, 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 "

[size="1"]";
    $items = mysql_query($sql);
    echo mysql_error();
    while ($item = mysql_fetch_array($items))
    {
      $lnk = "<a href=\"index.php?action=viewuser&who=$item[2]&sid=$sid\">$item[0]</a>";
      echo "$lnk - $item[1] 
";
    }
    echo "[/size]</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>";[code]

** visit my new forum wapsite on your mobile phone today.  wapfire.freehostia.com **

matthew26 Developer · 165 posts #17

can you add the code to the code above

** visit my new forum wapsite on your mobile phone today.  wapfire.freehostia.com **

wolf77ar Developer · 51 posts #18

can you add the code to the code above

else if($action=="online") {

addonline(getuid_sid($sid),"Online List",""); echo "<card id="main" title="ONLINE">";

//////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, 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))
{

$nopl = mysql_fetch_array(mysql_query("SELECT sex FROM ibwf_users WHERE id='".$item[2]."'"));

$uage = getage($nopl[1]); if($nopl[0]=='M') { $usex = "<img src="images/male.gif" alt="male"/>"; }else if($nopl[0]=='F'){ $usex = "<img src="images/female.gif" alt="female"/>"; }else{ $usex = "<img src="images/point.gif" alt="?"/>"; } $nopl[2] = htmlspecialchars($nopl[2]); $lnk = "<a href="index.php?action=viewuser&who=$item[2]&sid=$sid">$item[0]</a>"; echo "$usex $lnk - $item[1] "; } 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 " ";

This is the code Just Replace in your script The red text is modified zone where you can try to change

echo "<a href="http://wapcomunity.ro">[-Enter Here-]</a>";

matthew26 Developer · 165 posts #19

wow cheers mate ill get to it right now

** visit my new forum wapsite on your mobile phone today.  wapfire.freehostia.com **

matthew26 Developer · 165 posts #20

is this the error it gives error

XML parsing failed: syntax error (Line: 5, Character: 115)

Reparse document as HTML
Error:invalid entity reference in attribute value
Specification:[url]http://www.w3.org/TR/REC-xml/[/url]
  2: <wml>
  3: 
  4: 
  5: <card id="main" title="ONLINE">

[size="1"][img]images/male.gif[/img] [url="index.php?action=viewuser                                     [i][u]&who[[b][/b]/u][/i]=2&sid=f6740ed7cef96f2ed21da57eb4b5e90a"]admin[/url] - Online List 
[/size]</p><p align="center">
[size="1"]1/1[/size]
</p><p align="center">[url="index.php?action=main&sid=f6740ed7cef96f2ed21da57eb4b5e90a"][img]images/home.gif[/img]Home[/url]</p></card>
  6: </wml>
  7:

** visit my new forum wapsite on your mobile phone today.  wapfire.freehostia.com **

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