Lavalair Mods...

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

147 replies · 72,508 views · started 18 years ago · 1 min read

TL;DR · summary of 147 replies
  • -metulj provided a fixed code and usage instructions for the total unread PMs count feature.
  • -Rider added code to display user avatars next to their names in online lists, forums, etc.
  • -The profile moods functionality was discussed by opticalpigion, with a link provided for downloading images.
  • -No specific unresolved issues were mentioned regarding the forum mods.

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

48 participants
honkytonkman Senior · 252 posts #61

i already done it ..but it shows in page "Unknown column 'mdy' in 'field list'"

$sql = "SELECT id, who, partner, mdy FROM ibwf_chapel WHERE ismd='1' ORDER BY mdy DESC LIMIT $limit_start, $items_per_page";

what is mdy??

if i delete mdy in the code appears: Unknown column 'ismd' in 'where clause'

i think another thing not right for my chapel tables is $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chapel WHERE ismd='1'"));

the italian/international COMMUNITY of friendship http://people2000.netne.net WAP/WEB peoplemailbox@katamail.com

something else Fellow · 2,296 posts #62

ismd is except (i guess) and , mdy just delete that 🙂

honkytonkman Senior · 252 posts #63

more easy to change ibwf_chapel in couple in the code by something else.. deleted mdy but not works the same..always shows Unknown column 'ismd' in 'where clause'.. code $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chapel WHERE ismd='1'"));

changed in $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM couple WHERE ismd='1'")); not works..

the italian/international COMMUNITY of friendship http://people2000.netne.net WAP/WEB peoplemailbox@katamail.com

honkytonkman Senior · 252 posts #64

okay..let's done by myself..😊 this is the something else code working RIGHT for who uses couple sql tables instead ibwf-chapel .. i put it also the losing head..

[COLOR=#000000][COLOR=#007700]else if([/COLOR][COLOR=#0000bb]$action[/COLOR][COLOR=#007700]==[/COLOR][COLOR=#dd0000]"marry"[/COLOR][COLOR=#007700])
{
    [/COLOR][COLOR=#0000bb]addonline[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]getuid_sid[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$sid[/COLOR][COLOR=#007700]),[/COLOR][COLOR=#dd0000]"Wappied List"[/COLOR][COLOR=#007700],[/COLOR][COLOR=#dd0000]""[/COLOR][COLOR=#007700]);

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

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

   [/COLOR][COLOR=#ff8000]//////ALL LISTS SCRIPT <<

    [/COLOR][COLOR=#0000bb]$noi [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]mysql_fetch_array[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]mysql_query[/COLOR][COLOR=#007700]([/COLOR][COLOR=#dd0000]"SELECT COUNT(*) FROM couple WHERE accept='1'"[/COLOR][COLOR=#007700]));
    if([/COLOR][COLOR=#0000bb]$page[/COLOR][COLOR=#007700]==[/COLOR][COLOR=#dd0000]"" [/COLOR][COLOR=#007700]|| [/COLOR][COLOR=#0000bb]$page[/COLOR][COLOR=#007700]<=[/COLOR][COLOR=#0000bb]0[/COLOR][COLOR=#007700])[/COLOR][COLOR=#0000bb]$page[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]1[/COLOR][COLOR=#007700];
    [/COLOR][COLOR=#0000bb]$num_items [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]$noi[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]0[/COLOR][COLOR=#007700]]; [/COLOR][COLOR=#ff8000]//changable
    [/COLOR][COLOR=#0000bb]$items_per_page[/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]10[/COLOR][COLOR=#007700];
    [/COLOR][COLOR=#0000bb]$num_pages [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]ceil[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$num_items[/COLOR][COLOR=#007700]/[/COLOR][COLOR=#0000bb]$items_per_page[/COLOR][COLOR=#007700]);
    if(([/COLOR][COLOR=#0000bb]$page[/COLOR][COLOR=#007700]>[/COLOR][COLOR=#0000bb]$num_pages[/COLOR][COLOR=#007700])&&[/COLOR][COLOR=#0000bb]$page[/COLOR][COLOR=#007700]!=[/COLOR][COLOR=#0000bb]1[/COLOR][COLOR=#007700])[/COLOR][COLOR=#0000bb]$page[/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]$num_pages[/COLOR][COLOR=#007700];
    [/COLOR][COLOR=#0000bb]$limit_start [/COLOR][COLOR=#007700]= ([/COLOR][COLOR=#0000bb]$page[/COLOR][COLOR=#007700]-[/COLOR][COLOR=#0000bb]1[/COLOR][COLOR=#007700])*[/COLOR][COLOR=#0000bb]$items_per_page[/COLOR][COLOR=#007700];

    [/COLOR][COLOR=#ff8000]//changable sql

        [/COLOR][COLOR=#0000bb]$sql [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"SELECT id, who, partner, FROM couple WHERE accept='1' ORDER BY accept DESC LIMIT $limit_start, $items_per_page"[/COLOR][COLOR=#007700];

    echo [/COLOR][COLOR=#dd0000]"<p>"[/COLOR][COLOR=#007700];
    [/COLOR][COLOR=#0000bb]$items [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]mysql_query[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$sql[/COLOR][COLOR=#007700]);
    echo [/COLOR][COLOR=#0000bb]mysql_error[/COLOR][COLOR=#007700]();
    if([/COLOR][COLOR=#0000bb]mysql_num_rows[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$items[/COLOR][COLOR=#007700])>[/COLOR][COLOR=#0000bb]0[/COLOR][COLOR=#007700])
    {
    while ([/COLOR][COLOR=#0000bb]$item [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]mysql_fetch_array[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$items[/COLOR][COLOR=#007700]))
    {
[/COLOR][COLOR=#0000bb]$unick [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]getnick_uid[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$item[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]2[/COLOR][COLOR=#007700]]);
[/COLOR][COLOR=#0000bb]$wnick [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]getnick_uid[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$item[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]1[/COLOR][COLOR=#007700]]);
[/COLOR][COLOR=#0000bb]$lnk [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"<a href=\"index.php?action=viewuser&who=$item[2]\">$unick </a><b>is Wappied To </b><a href=\"index.php?action=viewuser&who=$item[1]\">$wnick </a><br/>"[/COLOR][COLOR=#007700];
      echo [/COLOR][COLOR=#dd0000]"$lnk<br/>"[/COLOR][COLOR=#007700];
    }
    }
    echo [/COLOR][COLOR=#dd0000]"</p>"[/COLOR][COLOR=#007700];
    echo [/COLOR][COLOR=#dd0000]"<p align=\"center\">"[/COLOR][COLOR=#007700];
    if([/COLOR][COLOR=#0000bb]$page[/COLOR][COLOR=#007700]>[/COLOR][COLOR=#0000bb]1[/COLOR][COLOR=#007700])
    {
      [/COLOR][COLOR=#0000bb]$ppage [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]$page[/COLOR][COLOR=#007700]-[/COLOR][COLOR=#0000bb]1[/COLOR][COLOR=#007700];
      echo [/COLOR][COLOR=#dd0000]"<a href=\"lists.php?action=marry&page=$ppage\">«PREV</a> "[/COLOR][COLOR=#007700];
    }
    if([/COLOR][COLOR=#0000bb]$page[/COLOR][COLOR=#007700]<[/COLOR][COLOR=#0000bb]$num_pages[/COLOR][COLOR=#007700])
    {
      [/COLOR][COLOR=#0000bb]$npage [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]$page[/COLOR][COLOR=#007700]+[/COLOR][COLOR=#0000bb]1[/COLOR][COLOR=#007700];
      echo [/COLOR][COLOR=#dd0000]"<a href=\"lists.php?action=marry&page=$npage\">Next»</a>"[/COLOR][COLOR=#007700];
    }
    echo [/COLOR][COLOR=#dd0000]"<br/>$page/$num_pages<br/>"[/COLOR][COLOR=#007700];
    echo [/COLOR][COLOR=#dd0000]"</p>"[/COLOR][COLOR=#007700];
    if([/COLOR][COLOR=#0000bb]$num_pages[/COLOR][COLOR=#007700]>[/COLOR][COLOR=#0000bb]2[/COLOR][COLOR=#007700])
    {
        [/COLOR][COLOR=#0000bb]$rets [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"<form action=\"lists.php\" method=\"get\">"[/COLOR][COLOR=#007700];
        [/COLOR][COLOR=#0000bb]$rets [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]"<input name=\"page\" style=\"-wap-input-format: '*N'\" size=\"2\"/>"[/COLOR][COLOR=#007700];
        [/COLOR][COLOR=#0000bb]$rets [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]"<input type=\"hidden\" name=\"action\" value=\"$action\"/>"[/COLOR][COLOR=#007700];
        [/COLOR][COLOR=#0000bb]$rets [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]"<input type=\"submit\" value=\"Go To Page\"/>"[/COLOR][COLOR=#007700];
        [/COLOR][COLOR=#0000bb]$rets [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]"</form>"[/COLOR][COLOR=#007700];
        echo [/COLOR][COLOR=#0000bb]$rets[/COLOR][COLOR=#007700];
    }

  [/COLOR][COLOR=#ff8000]////// UNTILL HERE >>
    [/COLOR][COLOR=#007700]echo [/COLOR][COLOR=#dd0000]"<p align=\"center\">"[/COLOR][COLOR=#007700];
    echo [/COLOR][COLOR=#dd0000]"<a href=\"chapel.php?action=main\">"[/COLOR][COLOR=#007700];
echo [/COLOR][COLOR=#dd0000]"Chapel</a><br/><br/>"[/COLOR][COLOR=#007700];
    echo [/COLOR][COLOR=#dd0000]"<a href=\"index.php?action=stats\"><img src=\"http://coding-talk.com/images/stat.gif\" alt=\"*\"/>"[/COLOR][COLOR=#007700];
echo [/COLOR][COLOR=#dd0000]"Site Stats</a><br/>"[/COLOR][COLOR=#007700];
}  [/COLOR][/COLOR]

the italian/international COMMUNITY of friendship http://people2000.netne.net WAP/WEB peoplemailbox@katamail.com

riderz Lead · 975 posts #65

honkytonkman wrote: okay..let's done by myself..😊 this is the something else code working RIGHT for who uses couple sql tables instead ibwf-chapel .. i put it also the losing head..

else if($action=="marry")
{
    addonline(getuid_sid($sid),"Wappied List","");

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


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

   //////ALL LISTS SCRIPT <<

    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM couple WHERE accept='1'"));
    if($page=="" || $page<=0)$page=1;
    $num_items = $noi[0]; //changable
    $items_per_page= 10;
    $num_pages = ceil($num_items/$items_per_page);
    if(($page>$num_pages)&&$page!=1)$page= $num_pages;
    $limit_start = ($page-1)*$items_per_page;

    //changable sql

        $sql = "SELECT id, who, partner, FROM couple WHERE accept='1' ORDER BY accept DESC LIMIT $limit_start, $items_per_page";


    echo "<p>";
    $items = mysql_query($sql);
    echo mysql_error();
    if(mysql_num_rows($items)>0)
    {
    while ($item = mysql_fetch_array($items))
    {
$unick = getnick_uid($item[2]);
$wnick = getnick_uid($item[1]);
$lnk = "<a href=\"index.php?action=viewuser&who=$item[2]\">$unick </a><b>is Wappied To </b><a href=\"index.php?action=viewuser&who=$item[1]\">$wnick </a><br/>";
      echo "$lnk<br/>";
    }
    }
    echo "</p>";
    echo "<p align=\"center\">";
    if($page>1)
    {
      $ppage = $page-1;
      echo "<a href=\"lists.php?action=marry&page=$ppage\">«PREV</a> ";
    }
    if($page<$num_pages)
    {
      $npage = $page+1;
      echo "<a href=\"lists.php?action=marry&page=$npage\">Next»</a>";
    }
    echo "<br/>$page/$num_pages<br/>";
    echo "</p>";
    if($num_pages>2)
    {
        $rets = "<form action=\"lists.php\" method=\"get\">";
        $rets .= "<input name=\"page\" style=\"-wap-input-format: '*N'\" size=\"2\"/>";
        $rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";
        $rets .= "<input type=\"submit\" value=\"Go To Page\"/>";
        $rets .= "</form>";
        echo $rets;
    }

  ////// UNTILL HERE >>
    echo "<p align=\"center\">";
    echo "<a href=\"chapel.php?action=main\">";
echo "Chapel</a><br/><br/>";
    echo "<a href=\"index.php?action=stats\"><img src=\"http://coding-talk.com/images/stat.gif\" alt=\"*\"/>";
echo "Site Stats</a><br/>";
}  

i get this error

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM couple WHERE accept='1' ORDER BY accept DESC LIMIT 0, 10' at line 1
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/revivewa/public_html/lists.php on line 1714

Jacques jacques@gw-designs.co.za http://coding.biz.tm Come join and lets make it a place to learn all the noobies how to code


NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

pmbguy Senior · 344 posts #66

ok, in your profile settings, you have a slot to put an url to your profile picture...

i kinda realised this is an open invite for hackers to link to a picture hosted on their own server and refer to the access logs to get a direct link to someone elses login, or session id with complete url to their profile as viewed with someone elses details...

so i set about to code this:

////////////////////////pictures function get_size($path) { $count=0; if(!is_dir($path)) return filesize($path); if ($handle = opendir($path)) { $size = 0; while (false !== ($file = readdir($handle))) { if($file!='.' && $file!='..' && $file!='index.php') {$count++; $size = get_size($path.'/'.$file); $sizekb = round(($size /1024),2); $sizemb = ($size / 1024)/1024; $sizemb = round($sizemb,2); $sizegb = (($size / 1024)/1024)/1024; $sizegb = round($sizegb,2); $userpic2=explode(".", $file);

echo "<option value="$file">$file - $sizekb KB</a>"; }

}
closedir($handle);
return $size;

} }


One problem, this lists all the pictures in the selected folder, (ie: male or female depending on sex)...

I'm having problems trying to get the next bit put together, but you'll see what i was trying to achieve... I hope:)

and here's the code to use the function...

else if($action=="picture") { echo "<head>

<title>Profile Pics</title> <link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\"> </head> <body>

"; echo "Pick your desired picture from the gallery below: "; echo "<form action="index.php?action=updtpropic&sid=$sid" method="post">";

echo " <select name="pic">";

$sexy=mysql_fetch_array(mysql_query("SELECT sex FROM ibwf_users WHERE id='".$uid."'")); if($sexy[0]=='M') { get_size('../male'); }

       if($sexy[0]=='F')
       {
       get_size('../female');
       }

echo "</select>";

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

echo "

</body>";

}

ok, here's what i planned, but never got to work... i wanna set it up so it only shows a users pics, not all the images in the folder...

////////////////////////pictures function get_size($path) { $count=0; if(!is_dir($path)) return filesize($path); if ($handle = opendir($path)) { $size = 0; while (false !== ($file = readdir($handle))) { if($file!='.' && $file!='..' && $file!='index.php') {$count++; $size = get_size($path.'/'.$file); // Do not use $size +=... $sizekb = round(($size /1024),2); $sizemb = ($size / 1024)/1024; $sizemb = round($sizemb,2); $sizegb = (($size / 1024)/1024)/1024; $sizegb = round($sizegb,2); $userpic2=explode(".", $file); //$userpic = $userpic2[0]; $nick = mysql_fetch_array(mysql_query("SELECT name FROM ibwf_users WHERE id='".$uid."'")); $desired1 = "".$nick[0]."(1)"; $desired2 = "$nick0"; $desired3 = "$nick0"; $desired4 = "$nick0"; $desired5 = "$nick0";

// if(("$userpic2[0]"=="".$nick."(1)")||("$userpic2[0]"=="".$nick."(2)")) //if (($userpic==$nick))

if($userpic2[0]==$desired1) { echo "<option value="$file">$file - $sizekb KB</a>"; } else {} }

}
closedir($handle);
return $size;

} }

////////////////////////pictures function get_size($path) { $count=0; if(!is_dir($path)) return filesize($path); if ($handle = opendir($path)) { $size = 0; while (false !== ($file = readdir($handle))) { if($file!='.' && $file!='..' && $file!='index.php') {$count++; $size = get_size($path.'/'.$file); // Do not use $size +=... $sizekb = round(($size /1024),2); $sizemb = ($size / 1024)/1024; $sizemb = round($sizemb,2); $sizegb = (($size / 1024)/1024)/1024; $sizegb = round($sizegb,2); $userpic2=explode(".", $file); //$userpic = $userpic2[0]; $nick = mysql_fetch_array(mysql_query("SELECT name FROM ibwf_users WHERE id='".$uid."'")); $desired1 = "".$nick[0]."(1)"; $desired2 = "$nick0"; $desired3 = "$nick0"; $desired4 = "$nick0"; $desired5 = "$nick0";

// if(("$userpic2[0]"=="".$nick."(1)")||("$userpic2[0]"=="".$nick."(2)")) //if (($userpic==$nick))

if($userpic2[0]==$desired1) { echo "<option value="$file">$file - $sizekb KB</a>"; } else {} }

}
closedir($handle);
return $size;

} }


And I know it's a mess, I was getting desparate towards the end... lol

and to set in db...

////////////////////////////propicset////////////////////////////////// else if($action=="setavatar") { $pic = $_POST["gallerypic"]; $uid = getuid_sid($sid); $exist = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE id='".$uid."'")); if ($exist[0]>0) { $sexy=mysql_fetch_array(mysql_query("SELECT sex FROM ibwf_users WHERE id='".$uid."'")); if($sexy[0]=='M') { $res = mysql_query("UPDATE ibwf_users SET avatar='../male/".$pic."' WHERE id='".$uid."'"); } if($sexy[0]=='F') { $res = mysql_query("UPDATE ibwf_users SET avatar='../female/".$pic."' WHERE id='".$uid."'"); } }else{ $sexy=mysql_fetch_array(mysql_query("SELECT sex FROM ibwf_users WHERE id='".$uid."'")); if($sexy[0]=='M') { $res = mysql_query("UPDATE ibwf_users SET avatar='../male/".$pic."' WHERE id='".$uid."'"); } if($sexy[0]=='F') { $res = mysql_query("UPDATE ibwf_users SET avatar='../female/".$pic."' WHERE id='".$uid."'"); } } echo "<meta http-equiv=Refresh content=0;url=main.php?action=main&sid=$sid>"; }

one last query, anyone know what i'm doing wrong here? cause it never seems to load the nick...

$userpic2=explode(".", $file); //$userpic = $userpic2[0]; $nick = mysql_fetch_array(mysql_query("SELECT name FROM ibwf_users WHERE id='".$uid."'")); $desired1 = "".$nick[0]."(1)"; $desired2 = "$nick0"; $desired3 = "$nick0"; $desired4 = "$nick0"; $desired5 = "$nick0";

// if(("$userpic2[0]"=="".$nick."(1)")||("$userpic2[0]"=="".$nick."(2)")) //if (($userpic==$nick))

if($userpic2[0]==$desired1)


sorry if my code is really messed up. this was my final try after six hours... i can't make it query the nick right...

pmbguy Senior · 344 posts #67

ok, basically, i've got the ../male and ../female gallery folders. the script above basically lists the folder contents in a drop down menu so you can select an image...

echo " <select name="pic">";

$sexy=mysql_fetch_array(mysql_query("SELECT sex FROM ibwf_users WHERE id='".$uid."'")); if($sexy[0]=='M') { get_size('../male'); }

if($sexy[0]=='F') { get_size('../female'); }

echo "</select>";

on that kinda thing, but i can't make the function load the user nick to get it to only show $nick0.$ext kinda thing... that's where i'm stuck... trying to make it work without adding all the uploaded pics in the database...

if you wanna see a demo, Welcome To USTDOZ check in the site extras... (P.S. This link isn't meant as spam)

m4ster_v4 Developer · 125 posts #68

Shout Room For WML Lavalair....

/*/*/put at core.php

function getshoutroom($sid)
{
  $shbox = "<b>ShoutRoom</b><br/>";
  $lshout = mysql_fetch_array(mysql_query("SELECT shout, shouter, id  FROM ibwf_shouts ORDER BY shtime DESC LIMIT 1"));

  $shnick = getnick_uid($lshout[1]);
  $shbox .= "<a href=\"index.php?action=viewuser&sid=$sid&who=$lshout[1]\">".$shnick."</a><br/>";
  $shbox .= parsepm($lshout[0], $sid);
  $shbox .= "<br/>";
  return $shbox;

}

/*/*/*/Put at lists.php 

else if($action=="shouts")
{
    addonline(getuid_sid($sid),"Shout Room","");

      echo "<card id=\"main\" title=\"eJaTd29.Co.Cc\" ontimer=\"lists.php?time=";
 echo date('dmHis');
 echo "&action=shouts&sid=$sid";
 echo "\">";
 echo "<timer value=\"500\"/>";
    echo "<onevent type=\"onenterforward\">";
    echo "<refresh>";
    echo "<setvar name=\"shtxt\" value=\"\"/>";
  echo "</refresh>";
  echo "</onevent>";

    //////ALL LISTS SCRIPT <<<<<
    if($page=="" || $page<=0)$page=1;

    if($who=="")
    {
    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_shouts"));
    }else{
    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_shouts WHERE shouter='".$who."'"));
    }

    $num_items = $noi[0]; //changable
    $items_per_page= 12;
    $num_pages = ceil($num_items/$items_per_page);
    if(($page>$num_pages)&&$page!=1)$page= $num_pages;
    $limit_start = ($page-1)*$items_per_page;
    //changable sql

    if($who =="")
    {
        $sql = "SELECT id, shout, shouter, shtime  FROM ibwf_shouts ORDER BY shtime DESC LIMIT $limit_start, $items_per_page";
}else{
    $sql = "SELECT id, shout, shouter, shtime  FROM ibwf_shouts  WHERE shouter='".$who."' ORDER BY shtime DESC LIMIT $limit_start, $items_per_page";
}
    echo "<p align=\"center\">";
    echo getshoutroom($sid);
  echo "<input name=\"shtxt\" maxlength=\"100\"/><br/>";
  echo "<anchor>Shout";
  echo "<go href=\"genproc.php?action=shout&sid=$sid\" method=\"post\">";
  echo "<postfield name=\"shtxt\" value=\"$(shtxt)\"/>";
  echo "</go>";
  echo "</anchor>";
    echo "</p>";
    echo "<p>";
  $time = date('dmHis');
  echo "<a href=\"lists.php?action=shouts&sid=$sid&time=$time\">Reload page</a><br/><br/>";
    $items = mysql_query($sql);
    echo mysql_error();
    if(mysql_num_rows($items)>0)
    {
    while ($item = mysql_fetch_array($items))
    {
        $shnick = getnick_uid($item[2]);
        $sht = parsepm($item[1], $sid);   

  $shdt = date("H:i - d/m",$item[3]);

      $lnk = "<a href=\"index.php?action=viewuser&who=$item[2]&sid=$sid\">$shnick</a> ~ $sht<br/><i>$shdt</i>";
      if(ismod(getuid_sid($sid)))
      {
      $dlsh = "<a href=\"modproc.php?action=delsh&sid=$sid&shid=$item[0]\">[x]</a>";
      }else{
        $dlsh = "";
      }
    
        echo "$lnk $dlsh<br/>";
    }
    }
    echo "</p>";
    echo "<p align=\"center\">";
    if($page>1)
    {
      $ppage = $page-1;
      echo "<a href=\"lists.php?action=shouts&page=$ppage&sid=$sid&who=$who\">«PREV</a> ";
    }
    if($page<$num_pages)
    {
      $npage = $page+1;
      echo "<a href=\"lists.php?action=shouts&page=$npage&sid=$sid&who=$who\">Next»</a>";
    }
    echo "<br/>Page $page of $num_pages<br/>";
    if($num_pages>2)
    {
      $rets = "Page<input name=\"pg\" format=\"*N\" size=\"3\"/>";
        $rets .= "<anchor>[GO]";
        $rets .= "<go href=\"lists.php\" method=\"get\">";
        $rets .= "<postfield name=\"action\" value=\"$action\"/>";
        $rets .= "<postfield name=\"who\" value=\"$who\"/>";
        $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
        $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
        $rets .= "</go></anchor>";

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

/*/*/Here direct link to enter sh0ut r0om.. Put at any place y0u want..
 echo "<a href=\"lists.php?action=shouts&sid=$sid\">Shout Room</a><br/>";

Visit my WEBSITE Project: http://www.aspirewap.net

pmbguy Senior · 344 posts #69

ok, i managed to code an auto installer for smilies, avatars, etc...

simply put the code below into a file and upload into the folder with your smilies and run it... it lists dir and with each file adds it to the database...

<HTML>
<HEAD>
 <TITLE>Smilies Auto Installer</TITLE>
</HEAD>
<BODY>
<?
/*
ok, i wrote this little script to do a directory listing and install all images as a smiley code on lavalair..
the smiley code comes out as the filename minus extension...  place in smilies folder and run it...
 to make it do other stuff modify lines 43 and 71 - pmbguy
*/

include("../web/config.php");
include("../web/core.php");
$bcon = connectdb();
if (!$bcon)
{
///////////////////////////SEVER ERROR//////////////////////////////////////////
echo "<head>
<title>Sever Updating</title>
<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/white_medium.css\">";
?>
<head>
<META HTTP-EQUIV="Refresh" Content="2">
</head>
<?php
echo "</head>
<body>
<p align=\"center\">
<img src=\"../phpThumb/phpThumb.php?src=../images/exit.gif\" alt=\"!\"/><br/>
<span style=\"color:red\"><b><u><i>Sever Updating</i></u></b></span>
<br/>Please Be Paticent Thank You!<br/>
<img src=\"../phpThumb/phpThumb.php?src=../images/loading.gif\" alt=\"[Loading]\"/><br/>";
$xfile = @file("randomloading.txt");
$random_num = rand (0,count($xfile)-1);
$udata = explode("::",$xfile[$random_num]);
echo "$udata[1]<br/>";
echo "</p>
</body>
</html>";
exit();
}
$res = mysql_query("TRUNCATE TABLE  `ibwf_smilies`"); // to modify to do avatars etc, change this line...

  // open this directory
$myDirectory = opendir(".");

// get each entry
while($entryName = readdir($myDirectory)) {
	$dirArray[] = $entryName;
}

// close directory
closedir($myDirectory);

//	count elements in array
$indexCount	= count($dirArray);
Print ("$indexCount files<br>\n");

// sort 'em
sort($dirArray);

// print 'em
print("<TABLE border=1 cellpadding=5 cellspacing=0 class=whitelinks>\n");
print("<TR><TH>Filename</TH><th>Filetype</th><th>Filesize</th></TR>\n");
// loop through the array of files and print them all
for($index=0; $index < $indexCount; $index++) {
        if (substr("$dirArray[$index]", 0, 1) != "."){ // don't list hidden files
		print("<TR><TD><a href=\"$dirArray[$index]\">$dirArray[$index]</a></td>");
		$userpic=explode(".", $dirArray[$index]);
  $res = mysql_query("INSERT INTO ibwf_smilies SET scode='-$userpic[0]-', imgsrc='../smilies/$dirArray[$index]', hidden='0'");   // to modify to do avatars etc, change this line...
		print("<td>");
		print(filetype($dirArray[$index]));
		print("</td>");
		print("<td>");
		print(filesize($dirArray[$index]));
		print("</td>");
		print("</TR>\n");
	}
}
print("</TABLE>\n");
?>
</BODY>
</HTML>
pmbguy Senior · 344 posts #70

try something like this for pm to staff, i think that's what you meant right...

else if($action=="sendSTAFFcast")
{
addonline(getuid_sid($sid),"Sending PM","index.php?action=$action");
  $pmtou = $_POST["pmtou"];
  $byuid = getuid_sid($sid);
echo "<head>";
  echo "<title>send inbox to all staff</title>";
  $theme = getbyknox($sid);
  echo "$theme";
  echo "</head>";
  echo "<body>";
  echo "<p>";
 $tm = time();
  $lastpm = mysql_fetch_array(mysql_query("SELECT MAX(timesent) FROM ibwf_private WHERE byuid='".$byuid."'"));
  echo "All Staff (except mods) has been sent this PM<br/>";
  $pms = mysql_query("SELECT id, name FROM ibwf_users WHERE perm>'1'");
  $tm = time();
  while($pm=mysql_fetch_array($pms))
  {
  mysql_query("INSERT INTO ibwf_private SET text='[b]PM to all staff[/b][br/]".$pmtou."[br/][i]This message was sent to all the staff except mods...[/i]', byuid='".$byuid."', touid='".$pm[0]."', timesent='".$tm."'");
  }
echo "<p align=\"center\">";

echo "</p>";
echo "<p align=\"center\">";
echo "<a href=\"main.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "</body>";
echo "</html>";
}
brand Senior · 391 posts #71

WhiteWarrior wrote: Visit Counter For Each MemberAdd New Table In ibwf_users

**`visit` varchar(255) NOT NULL default '0'

Add To Login.php

$uid = getuid_sid($sid);
$addv = mysql_fetch_array(mysql_query("SELECT visit FROM ibwf_users WHERE id='".$uid."'"));
$addv = $addhitv[0] + 1;
$addvisit = mysql_query("UPDATE ibwf_users SET visit='".$addv."' WHERE id='".$uid."'");

Add To Index.php?action=main

$nick = getnick_sid($sid);
$uid = getuid_sid($sid);
$showv = mysql_fetch_array(mysql_query("SELECT visit FROM ibwf_users WHERE id='".$uid."'"));
echo "Hello $nick,
This Is Your $showv[0]. Visit!";

has any one had any problems with this just i added it to my tester site and when i log out and logs back in it only says i have visited the site 1 time

HELP THEM WHO HELPS YOU

External image (may be gone)

i only work on wapdesire v_2 coding only

honkytonkman Senior · 252 posts #72

one thing i've been lookin' for , that at final i done by myself..this codes will show ya hour of the messages in chatrooms , exemple: JOHNDOE-12,35, hi folks ..is anybody here?

in chat.php page put this :

 $newtime = date("H:i,$seeit");

then find the following code and replaced with this:

$chatok = mysql_query("INSERT INTO ibwf_chat SET  chatter='".$uid."', who='".$who."', timesent='".time()."', msgtext='".$newtime." ".$message."', rid='".$rid."';");

$newtime will make appears hour into message.

the italian/international COMMUNITY of friendship http://people2000.netne.net WAP/WEB peoplemailbox@katamail.com

honkytonkman Senior · 252 posts #75

riderz wrote: here are mine im using mabe u can check whats diff

$text = preg_replace("/\[img\=(.*?)\]/is","<table cellpadding=\"3px\"\"><tr><td><img src=\"phpthumb.php?image=$1\"></td></tr></td></tr></table>",$text);
$text = preg_replace("/\[img\=(.*?)\]/is","<img src=\"phpthumb.php?image=$1\">",$text);

i don't know why but don't works in my lava..using one or the other ,always appears between External image (may be gone) the link but not the image

the italian/international COMMUNITY of friendship http://people2000.netne.net WAP/WEB peoplemailbox@katamail.com

coolboiz1 Junior · 13 posts #77

brand wrote: has any one had any problems with this just i added it to my tester site and when i log out and logs back in it only says i have visited the site 1 time

$uid = getuid_sid($sid); $addvhitv = mysql_fetch_array(mysql_query("SELECT visit FROM ibwf_users WHERE id='".$uid."'")); $addv = $addhitv[0] + 1; $addvisit = mysql_query("UPDATE ibwf_users SET visit='".$addv."' WHERE id='".$uid."'");

jsyguy23 Developer · 134 posts #78

$count_visit=mysql_fetch_array(mysql_query("SELECT visit FROM members WHERE username='".$username."'")); $visit=$count_visit[0]+1; mysql_query("UPDATE members SET visit='".$visit."' WHERE username='".$username."'");

something else Fellow · 2,296 posts #79

or even shorter:

mysql_query("UPDATE ibwf_users SET visit=visit+1 WHERE id='".$uid."'");

something else Fellow · 2,296 posts #80

Here is a very simple uploader for lava avatars

index.php

}else if($action=="uploadav"){
echo '<form enctype="multipart/form-data" action="genproc.php.php?action=uploadav&sid=$sid" method="POST">
 Pic: <input name="pic" type="file"/><br/>
 <input type="submit" value="Upload"/>
 </form>';
}

genproc.php

}else if($action=="uploadav"){
$path="avatars/".$HTTP_POST_FILES['pic']['name'];
if($pic!="none")
{
if(copy($HTTP_POST_FILES['pic']['tmp_name'], $path))
{
echo "Successful<br/>"; 
mysql_query("UPDATE ibwf_users SET avatar='".$path."' WHERE uid='".$uid."'");
}
else
{
echo "Error<br/>";
}
}
}

NOTE: You may want to add your own security to this uploader

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