Lavalair Mods...
Started on the old forum in June 2008 · view the original in the archive · old links redirect here
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.
yes it means not equal
oh the original script explodes browser name try:
$bro = mysql_fetch_array(mysql_query("SELECT browserm FROM ibwf_users WHERE id='".$uid."'"));
$brws = $_SERVER['HTTP_USER_AGENT'];
$brws = explode(" ", $brws);
if($bro[0]!=$brws[0]){
echo "hei 420 site sid proteced lol";
exit;
}
Added after 32 minutes:
kafa wrote: I need some advice or help:
how to speed up the function that displays number of topics, number of posts and the last post (nick and time) of the subforum on my web extension of lava (trying to make it phpBB like)?
Try This I havent Tested it:
$forums = mysql_query("SELECT id, name FROM ibwf_forums WHERE cid='".$cid."' AND clubid='0' ORDER BY position, id, name");
while($forum = mysql_fetch_array($forums))
{
if(canaccess(getuid_sid($sid), $forum[0]))
{
$notp = mysql_fetch_array(mysql_query("SELECT COUNT(*), id, name FROM ibwf_topics WHERE fid='".$forum[0]."'"));
$nops = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_topics WHERE tid='".$notp[1]."'"));
if($nops[0]==0)
{
$pinfo = mysql_fetch_array(mysql_query("SELECT authorid FROM ibwf_topics WHERE id='".$notp[1]."'"));
}else{
$pinfo = mysql_fetch_array(mysql_query("SELECT uid FROM ibwf_posts WHERE tid='".$notp[1]."'"));
}
echo "<tr>
<td valign=\"middle\" width=\"25\"> <img src=\"images/1.gif\" alt=\"*\"/></td>
<td align=\"left\" width=\"200\" class=\"sjena\"> <a href=\"index.php?action=viewfrm&sid=$sid&fid=$forum[0]\">$forum[1]</a></td>
<td width=\"50\" align=\"center\" class=\"sjena\">$notp[0]</td>
<td width=\"60\" align=\"center\" class=\"sjena\">$nops[0]</td>
<td align=\"right\" class=\"style12\">
<a href=\"index.php?action=viewtpc&sid=$sid&tid=$lpt[1]&go=last\">".htmlspecialchars($notp[2])."</a> <br/>
od: <a href=\"index.php?action=viewuser&sid=$sid&who=$pinfo[0]\">".getnick_uid($pinfo[0])."</a> </td>
</tr><tr><td colspan=\"5\"><hr></td></tr>";
}
}
something else wrote: Try This I havent Tested it:
$notp = mysql_fetch_array(mysql_query("SELECT COUNT(*), id, name FROM ibwf_topics WHERE fid='".$forum[0]."'")); $nops = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_topics WHERE tid='".$notp[1]."'"));
It does'nt work cus of this part: SELECT COUNT(*), id, name FROM ibwf_topics returns => mysql_fetch_array(): supplied argument is not a valid MySQL result resource
http://merak.mobi - Love at first click
COUNT(*), id, name <-- Wrong! COUNT('id','name') <-- Right
Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!
SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…
oops:
$forums = mysql_query("SELECT id, name FROM ibwf_forums WHERE cid='".$cid."' AND clubid='0' ORDER BY position, id, name");
while($forum = mysql_fetch_array($forums))
{
if(canaccess(getuid_sid($sid), $forum[0]))
{
$notp = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_topics WHERE fid='".$forum[0]."'"));
$tpi = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_topics WHERE fid='".$forum[0]."'"));
$nops = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_topics WHERE tid='".$tpi0]."'"));
if($nops[0]==0)
{
$pinfo = mysql_fetch_array(mysql_query("SELECT authorid FROM ibwf_topics WHERE id='".$tpi[0]."'"));
}else{
$pinfo = mysql_fetch_array(mysql_query("SELECT uid FROM ibwf_posts WHERE tid='".$tpi[0]."'"));
}
echo "<tr>
<td valign=\"middle\" width=\"25\"> <img src=\"images/1.gif\" alt=\"*\"/></td>
<td align=\"left\" width=\"200\" class=\"sjena\"> <a href=\"index.php?action=viewfrm&sid=$sid&fid=$forum[0]\">$forum[1]</a></td>
<td width=\"50\" align=\"center\" class=\"sjena\">$notp[0]</td>
<td width=\"60\" align=\"center\" class=\"sjena\">$nops[0]</td>
<td align=\"right\" class=\"style12\">
<a href=\"index.php?action=viewtpc&sid=$sid&tid=$lpt[1]&go=last\">".htmlspecialchars($tpi[1])."</a> <br/>
od: <a href=\"index.php?action=viewuser&sid=$sid&who=$pinfo[0]\">".getnick_uid($pinfo[0])."</a> </td>
works perfect tested aswell:
something else wrote: Total online time and hourly reward of 50 plusses
//////////////////////////////////////////////////////////////////// addonline function addonline($uid,$place,$plclink){ $tm = time(); $timeout = $tm - 300; //time out = 5 minutes mysql_query("DELETE FROM ibwf_online WHERE actvtime <'".$timeout."'"); $lttime = mysql_fetch_array(mysql_query("SELECT lastact, plustime FROM ibwf_users WHERE id='".$uid."'")); $limit = $tm - $lttime[0]; if($limit<60){ //limit to 60 seconds away $newtime = $lttime[1] + $limit; if($newtime>3600){ //1 hour mysql_query("UPDATE ibwf_users SET plustime='0', totaltime=toaltime+$newtime, plusses=plusses+50 WHERE id='".$uid."'"); $msg = "Congratulation! You are Have Been Online For 1 Hour. You Have Recieved 50 plusses [br/][small]Note: This is an automated PM[/small]"; autopm($msg, $uid); }else{ mysql_query("UPDATE ibwf_users SET totaltime=toaltime+$newtime, plustime='".$newtime."' WHERE id='".$uid."'"); } } mysql_query("UPDATE ibwf_users SET lastact='".$tm."' WHERE id='".$uid."'"); $res = mysql_query("INSERT INTO ibwf_online SET userid='".$uid."', actvtime='".$tm."', place='".$place."', placedet='".$plclink."'"); if(!$res){ $res = mysql_query("UPDATE ibwf_online SET actvtime='".$tm."', place='".$place."', placedet='".$plclink."', hide='".$hide."' WHERE userid='".$uid."'"); } $maxmem = mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE id='2'")); $result = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_online")); if($result[0]>=$maxmem[0]){ mysql_query("UPDATE ibwf_settings set name='".date("D d M Y - H:i")."', value='".$result[0]."' WHERE id='2'"); } $maxtoday = mysql_fetch_array(mysql_query("SELECT ppl FROM ibwf_mpot WHERE ddt='".date("d m y")."'")); if($maxtoday[0]==0||$maxtoday==""){ mysql_query("INSERT INTO ibwf_mpot SET ddt='".date("d m y")."', ppl='1', dtm='".date("H:i:s")."'"); $maxtoday[0]=1; } if($result[0]>=$maxtoday[0]){ mysql_query("UPDATE ibwf_mpot SET ppl='".$result[0]."', dtm='".date("H:i:s")."' WHERE ddt='".date("d m y")."'"); } }ALTER TABLE `ibwf_users` ADD `totaltime` INT(100) NOT NULL DEFAULT '0'; ALTER TABLE `ibwf_users` ADD `plustime` INT( 5 ) NOT NULL DEFAULT '0';Added after 2 minutes:
to call:
$ttime = mysql_fetch_array(mysql_query("SELECT totaltime FROM ibwf_users WHERE id='".$uid."'")); echo "Total Online Time: $ttime[0]";
//////////////////////////////////////////////////////////////////// addonline
function addonline($uid,$place,$plclink){
$tm = time();
$timeout = $tm - 300; //time out = 5 minutes
mysql_query("DELETE FROM ibwf_online WHERE actvtime <'".$timeout."'");
$lttime = mysql_fetch_array(mysql_query("SELECT lastact, plustime FROM ibwf_users WHERE id='".$uid."'"));
$limit = $tm - $lttime[0];
if($limit<60){ //limit to 60 seconds away
$newtime = $lttime[1] + $limit;
if($newtime>3600){ //1 hour
mysql_query("UPDATE ibwf_users SET plustime='0', totaltime=toaltime+$newtime, plusses=plusses+50 WHERE id='".$uid."'");
$msg = "Congratulation! You are Have Been Online For 1 Hour. You Have Recieved 50 plusses [br/][small]Note: This is an automated PM[/small]";
autopm($msg, $uid);
}else{
mysql_query("UPDATE ibwf_users SET totaltime=toaltime+$newtime, plustime='".$newtime."' WHERE id='".$uid."'");
}
}
mysql_query("UPDATE ibwf_users SET lastact='".$tm."' WHERE id='".$uid."'");
$res = mysql_query("INSERT INTO ibwf_online SET userid='".$uid."', actvtime='".$tm."', place='".$place."', placedet='".$plclink."'");
if(!$res){
$res = mysql_query("UPDATE ibwf_online SET actvtime='".$tm."', place='".$place."', placedet='".$plclink."', hide='".$hide."' WHERE userid='".$uid."'");
}
$maxmem = mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE id='2'"));
$result = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_online"));
if($result[0]>=$maxmem[0]){
mysql_query("UPDATE ibwf_settings set name='".date("D d M Y - H:i")."', value='".$result[0]."' WHERE id='2'");
}
$maxtoday = mysql_fetch_array(mysql_query("SELECT ppl FROM ibwf_mpot WHERE ddt='".date("d m y")."'"));
if($maxtoday[0]==0||$maxtoday==""){
mysql_query("INSERT INTO ibwf_mpot SET ddt='".date("d m y")."', ppl='1', dtm='".date("H:i:s")."'");
$maxtoday[0]=1;
}
if($result[0]>=$maxtoday[0]){
mysql_query("UPDATE ibwf_mpot SET ppl='".$result[0]."', dtm='".date("H:i:s")."' WHERE ddt='".date("d m y")."'");
}
}
Where do I have to add this as I've tried adding it to core.php but it wont work.
ok, well if you added it but didn't overwrite the previous version of function, i'm guessing if your errors on, it says:
cannot redeclare addonline (already declared in core.php on line ***...)
go to that line n check if it's the modified one, if so remove the double copy of function that isn't the one you modified...
C3 Themes: http://c3themes.wen.ru/index.html Find Files: http://mystarter.tk/?goto=X-search
pmbguy wrote: ok, well if you added it but didn't overwrite the previous version of function, i'm guessing if your errors on, it says:
cannot redeclare addonline (already declared in core.php on line ***...)
go to that line n check if it's the modified one, if so remove the double copy of function that isn't the one you modified...
No not getting any error message, the "time online" is just showing up as 0
have you altered the sql?
ALTER TABLE `ibwf_users` ADD `totaltime` INT(100) NOT NULL DEFAULT '0';
ALTER TABLE `ibwf_users` ADD `plustime` INT( 5 ) NOT NULL DEFAULT '0';
something else wrote: have you altered the sql?
ALTER TABLE `ibwf_users` ADD `totaltime` INT(100) NOT NULL DEFAULT '0'; ALTER TABLE `ibwf_users` ADD `plustime` INT( 5 ) NOT NULL DEFAULT '0';
yeah i copied everything you posted a few messages up.
Yet it still shows up as "Total Online Time: 0".
something else wrote: have you altered the sql?
ALTER TABLE `ibwf_users` ADD `totaltime` INT(100) NOT NULL DEFAULT '0'; ALTER TABLE `ibwf_users` ADD `plustime` INT( 5 ) NOT NULL DEFAULT '0';
yeah i copied everything you posted a few messages up.
Yet it still shows up as "Total Online Time: 0".
oops there is a typo: mysql_query("UPDATE ibwf_users SET plustime='0', totaltime=toaltime+$newtime, plusses=plusses+50 WHERE id='".$uid."'"); toaltime should be totaltime
something else wrote: oops there is a typo: mysql_query("UPDATE ibwf_users SET plustime='0', totaltime=toaltime+$newtime, plusses=plusses+50 WHERE id='".$uid."'"); toaltime should be totaltime
function addonline($uid,$place,$plclink)
{
$tm = time();
$timeout = $tm - 300; //time out = 5 minutes
mysql_query("DELETE FROM ibwf_online WHERE actvtime <'".$timeout."'");
$lttime = mysql_fetch_array(mysql_query("SELECT lastact, plustime FROM ibwf_users WHERE id='".$uid."'"));
$limit = $tm - $lttime[0];
if($limit<60){ //limit to 60 seconds away
$newtime = $lttime[1] + $limit;
if($newtime>3600){ //1 hour
mysql_query("UPDATE ibwf_users SET plustime='0', totaltime=totaltime+$newtime, plusses=plusses+50 WHERE id='".$uid."'");
$msg = "Congratulation! You are Have Been Online For 1 Hour. You Have Recieved 50 plusses [br/][small]Note: This is an automated PM[/small]";
autopm($msg, $uid);
}else{
mysql_query("UPDATE ibwf_users SET totaltime=totaltime+$newtime, plustime='".$newtime."' WHERE id='".$uid."'");
}
}
mysql_query("UPDATE ibwf_users SET lastact='".$tm."' WHERE id='".$uid."'");
$res = mysql_query("INSERT INTO ibwf_online SET userid='".$uid."', actvtime='".$tm."', place='".$place."', placedet='".$plclink."'");
if(!$res){
$res = mysql_query("UPDATE ibwf_online SET actvtime='".$tm."', place='".$place."', placedet='".$plclink."', hide='".$hide."' WHERE userid='".$uid."'");
}
$maxmem = mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE id='2'"));
$result = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_online"));
if($result[0]>=$maxmem[0]){
mysql_query("UPDATE ibwf_settings set name='".date("D d M Y - H:i")."', value='".$result[0]."' WHERE id='2'");
}
$maxtoday = mysql_fetch_array(mysql_query("SELECT ppl FROM ibwf_mpot WHERE ddt='".date("d m y")."'"));
if($maxtoday[0]==0||$maxtoday==""){
mysql_query("INSERT INTO ibwf_mpot SET ddt='".date("d m y")."', ppl='1', dtm='".date("H:i:s")."'");
$maxtoday[0]=1;
}
if($result[0]>=$maxtoday[0]){
mysql_query("UPDATE ibwf_mpot SET ppl='".$result[0]."', dtm='".date("H:i:s")."' WHERE ddt='".date("d m y")."'");
}
}
Thats what I have in the core.php & its giving me a blank page, counted the {} & () and there seems to be 2 more ) than ( is this right ?
How to create THANKS script on post forum.. Any 1 know? Help plz..
yeah... it's not that hard...
create new table called thanks or whatever...
must have 3 fields, or well up to as many as you want depending how much info you plan to log...
- id
- postid
- thankzfrm
- timethanked (optional)
- thankzfrmip (really bored, lol)
ok, then by each post you make it get count from thanks where post id = $postid...
in genproc, code a thanks action that inserts into thanks, postid= $postid, thankzfrm = $uid kinda thing...
if you going the whole way n adding a list of thankers too, you can add the timethanked bit so you got something to order it by when getting list...
hope this helps...
I would post the code up, but not coded it yet, lol...
C3 Themes: http://c3themes.wen.ru/index.html Find Files: http://mystarter.tk/?goto=X-search
If you put a quote ' after yo $who variable, you'll get an SQL error
i.e.
web/ownercp.php?action=user&sid=616064d42404f02dc07c8d614cbe2456&who=2'
You'll get Sql error which shows the $who is vuln to SQLi.
Quick fix,
Add this to core.php
function clean_url($text) {
FUNCTION BY Webune - Webune - Web Site Design Development Dedicated Hosting Domains Business Company AND WALLPAPERAMA.COM
PLEASE DO NOT REMOVE THIS.. THANK YOU
$text=strtolower($text); $code_entities_match = array( '"' ,'!' ,'@' ,'#' ,'$' ,'%' ,'^' ,'&' ,'' ,'(' ,')' ,'+' ,'{' ,'}' ,'|' ,':' ,'"' ,'<' ,'>' ,'?' ,'[' ,']' ,'' ,';' ,"'" ,',' ,'.' ,'_' ,'/' ,'' ,'+' ,'~' ,'`' ,'=' ,' ' ,'---' ,'--','--'); $code_entities_replace = array('' ,'-' ,'-' ,'' ,'' ,'' ,'-' ,'-' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'-' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'-' ,'' ,'-' ,'-' ,'' ,'' ,'' ,'' ,'' ,'-' ,'-' ,'-','-'); $text = str_replace($code_entities_match, $code_entities_replace, $text); return $text; }
and also
change
$who = $_GET['who'];
to
$who = (int) $_GET['who'];
in all pages
and finally in .htaccess,
Turn register globals off
something else wrote: yeah you could just add:
if(isset($_GET)){foreach($_GET as $key=>$value){$_GET[$key]=addslashes(htmlspecialchars($value));}} if(isset($_POST)){foreach($_POST as $key=>$value){$_POST[$key]=addslashes(htmlspecialchars($value));}} if(isset($_SERVER)){foreach($_SERVER as $key=>$value){$_SERVER[$key]=addslashes(htmlspecialchars($value));}} if(isset($_SESSION)){foreach($_SESSION as $key=>$value){$_SESSION[$key]=addslashes(htmlspecialchars($value));}}to your config.php
i got Warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/musicraj/public_html/forum/config.php on line 8 problem, how to solve it? i just put the code on config.php , sud i put something at core.php?
zubaer9 wrote: i got Warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/musicraj/public_html/forum/config.php on line 8 problem, how to solve it? i just put the code on config.php , sud i put something at core.php?
function ewanz($txt){
$txt = htmlentities($txt, ENT_QUOTES, 'UTF-8');
return $txt;}
if(isset($_POST)){foreach($_POST as $key=>$value){$_POST[$key]=ewanz($value);}}
if(isset($_GET)){foreach($_GET as $key=>$value){$_GET[$key]=ewanz($value);}}
if(isset($_REQUEST)){foreach($_REQUEST as $key=>$value){$_REQUEST[$key]=ewanz($value);}}
thats mine... u also can add for $_SESSION / $_SERVER or other globals.. =)
our lfe is simple words.... 😌 http://mygenkz.net ewanz06@yahoo.com
$output="i am NOoob....";
$newfile="ewanz.txt";
$file = fopen ($newfile, "w");
fwrite($file, $output);
fclose ($file);
HELP To speedup this!
SOMEONE HELP to speed up "View category" func?it very slow to open this...this is code what I using now
else if($action=="viewcat") { $cid = $_GET["cid"]; addonline(getuid_sid($sid),"Gleda kategorije",""); $cinfo = mysql_fetch_array(mysql_query("SELECT name from iwbf_fcats WHERE id='".$cid."'"));
echo "
"; echo getshoutbox($sid); echo " "; echo " "; $forums = mysql_query("SELECT id, name FROM iwbf_forums WHERE cid='".$cid."' AND clubid='0' ORDER BY position, id, name"); echo ""; while($forum = mysql_fetch_array($forums)) { if(canaccess(getuid_sid($sid), $forum[0])) { $notp = mysql_fetch_array(mysql_query("SELECT COUNT() FROM iwbf_topics WHERE fid='".$forum[0]."'")); $nops = mysql_fetch_array(mysql_query("SELECT COUNT() FROM iwbf_posts a INNER JOIN iwbf_topics b ON a.tid = b.id WHERE b.fid='".$forum[0]."'")); $iml = "<img src="images/1.gif" alt=""/>"; echo "<a href="index.php?action=viewfrm&sid=$sid&fid=$forum[0]">$iml$forum1</a> "; $lpt = mysql_fetch_array(mysql_query("SELECT id, name FROM iwbf_topics WHERE fid='".$forum[0]."' ORDER BY lastpost DESC LIMIT 0,1")); $nops = mysql_fetch_array(mysql_query("SELECT COUNT() FROM iwbf_posts WHERE tid='".$lpt[0]."'")); if($nops[0]==0) { $pinfo = mysql_fetch_array(mysql_query("SELECT authorid FROM iwbf_topics WHERE id='".$lpt[0]."'")); $tluid = $pinfo[0];
}else{
$pinfo = mysql_fetch_array(mysql_query("SELECT uid FROM iwbf_posts WHERE tid='".$lpt[0]."' ORDER BY dtpost DESC LIMIT 0, 1"));
$tluid = $pinfo[0];
}
$tlnm = htmlspecialchars($lpt[1]);
$tlnick = getnick_uid($tluid);
$tpclnk = "<a href=\"index.php?action=viewtpc&sid=$sid&tid=$lpt[0]&go=last\">$tlnm</a>";
$vulnk = "<a href=\"index.php?action=viewuser&sid=$sid&who=$tluid\">$tlnick</a>";
echo "Zadnji post u temi: $tpclnk, od: $vulnk
"; } } echo ""; echo " "; echo " "; $tmsg = getpmcount(getuid_sid($sid)); $umsg = getunreadpm(getuid_sid($sid)); if($umsg>0) { echo "<a href="inbox.php?action=main&sid=$sid">Inbox($umsg/$tmsg)</a> "; } echo "<a href="index.php?action=main&sid=$sid"><img src="images/home.gif" alt="*"/>"; echo "Home</a>"; echo " ";
}