View Full Version : Need help finding this hack
Carthriller
06-01-2002, 03:53 PM
Does anyone know where I can obtain a specific hack in this vbulletin:
http://forums.asianxo.com/
The hack I am looking for is under each category, where you see the new post icon, create a new thread icon, and the subscribe icon. Any help will be greatly appreciated, thank you.
Lesane
06-01-2002, 04:12 PM
https://vborg.vbsupport.ru/showthread.php?s=&threadid=35660 ;)
Carthriller
06-01-2002, 06:15 PM
Thanks for the quick reply Lesane, but what about the search for newest post icon. I'm trying to find the query string that can do that that for me, but can't seem to get it to work? Any suggestions?
Carthriller
06-01-2002, 07:44 PM
I have a link to it in the first post.
http://forums.asianxo.com/
Next to any categories are 3 icons, I want to know what the query string for the first icon(search) is? I can't figure it out to work on my site. (The two other ones are included in the hack that Lesane so graciously provided.)
Carthriller
06-01-2002, 09:17 PM
Essentially I want to know when a user click on an icon, what query string will bring him to the latest post for that forum?
<a href="search.php?action=getlatest&forumid=$forum[forumid]">icon</a>, but that didn't work.
Any suggestions?
Carthriller
06-02-2002, 04:19 AM
Does anyone know how to do this, please help, thanks
Lesane
06-07-2002, 08:02 PM
Open root/search.php and find:
// ###################### Start getsearchforums #######################
Add BEFORE it:
// ###################### Start get latest #######################
if ($action=="getlatest") {
// generate query
// do it!
if ($bbuserinfo[userid]!=0 or $bbuserinfo[lastvisit]!=0) {
$forumsql=" AND forumid=$forumid";
// get date:
$datesql=" AND thread.lastpost>=".$bbuserinfo[lastvisit];
$wheresql="1=1".$forumsql.$datesql;
$wheresql.=" AND thread.open<>10";
if ($getsearch=$DB_site->query_first("SELECT searchid FROM search WHERE query='".addslashes($wheresql)."'")) {
$searchid=$getsearch[searchid];
} else {
// get last search for this user and check floodcheck
if ($prevsearch=$DB_site->query_first("SELECT searchid,dateline FROM search WHERE ".iif($bbuserinfo[userid]==0,"ipaddress='$ipaddress'","userid=$bbuserinfo[userid]")." ORDER BY dateline DESC LIMIT 1")) {
if (time()-$prevsearch[dateline]<$searchfloodcheck and $searchfloodcheck!=0) { // and !ismoderator()) {
eval("standarderror(\"".gettemplate("error_pmfloodcheck")."\");");
exit;
}
}
// insert query into db
$DB_site->query("INSERT INTO search (searchid,query,dateline,querystring,showposts,use rid,ipaddress) VALUES (NULL,'".addslashes($wheresql)."',".time().",'".addslashes($query)."',0,$bbuserinfo[userid],'".addslashes($ipaddress)."')");
$searchid=$DB_site->insert_id();
}
eval("standardredirect(\"".gettemplate("redirect_search")."\",\"search.php?s=$session[sessionhash]&action=showresults&getnew=true&searchid=$searchid\");");
} else {
$action="getdaily";
}
}
Now u can use this link to get the results of a specific forum:
search.php?action=getlatest&forumid=XX
Where xx is the forumid.
As you can see on my forum i putted it in the template: "Forum Home Page Templates -> forumhome_forumbit_level1_post & forumhome_forumbit_level2_post with the following code:
<a href="search.php?action=getlatest&&forumid=$forum[forumid]">Read New Posts</a>
Done.
Chris M
06-07-2002, 08:52 PM
Lesane...
When I made your mod, I got this error :
Parse error: parse error in /usr/local/psa/home/vhosts/wootage.net/httpdocs/forums/search.php on line 126
Satan
Chris M
06-07-2002, 08:54 PM
Here are the lines...
$datesql=" AND thread.lastpost>=".$bbuserinfo[lastvisit];
$wheresql="1=1".$forumsql.$datesql;
$wheresql.=" AND thread.open<>10";
if ($getsearch=$DB_site->query_first("SELECT searchid FROM search WHERE query='".addslashes <http://www.php.net/addslashes>($wheresql)."'")) {
$searchid=$getsearch[searchid];
} else {
// get last search for this user and check floodcheck
Satan
Carthriller
06-07-2002, 09:17 PM
I used <a href="search.php?action=getlatest&forumid=$forum[forumid]">Read New Posts</a> and that didn't work. It just sent to a page where the search can't be found, even though there were some new posts. Please help.
Lesane
06-07-2002, 09:32 PM
Originally posted by hellsatan
Here are the lines...
$datesql=" AND thread.lastpost>=".$bbuserinfo[lastvisit];
$wheresql="1=1".$forumsql.$datesql;
$wheresql.=" AND thread.open<>10";
if ($getsearch=$DB_site->query_first("SELECT searchid FROM search WHERE query='".addslashes <http://www.php.net/addslashes>($wheresql)."'")) {
$searchid=$getsearch[searchid];
} else {
// get last search for this user and check floodcheck
Satan
Somehow you get some vbulletin and php.net stuff in it, copy and paste the code wich i posted again.
Lesane
06-07-2002, 09:34 PM
Originally posted by Carthriller
I used <a href="search.php?action=getlatest&forumid=$forum[forumid]">Read New Posts</a> and that didn't work. It just sent to a page where the search can't be found, even though there were some new posts. Please help.
Wich vb version are you using?
Carthriller
06-07-2002, 09:40 PM
I'm using VB2.2.5 integrated with Vbportal3.0
Carthriller
06-07-2002, 09:48 PM
I just edited template forumhome_forumbit_level2_post and not forumhome_forumbit_level1_post...which shouldn't matter right?
Carthriller
06-07-2002, 10:24 PM
After playing with it, is strange, the first two category shows the lastest posts, but the rest of the categories don't work. Why is this so?
Carthriller
06-07-2002, 10:58 PM
I figured something out. The reason why the first couple of categories worked for this hack is cause there were not any embedded categories in them...while in the other categories, there are sub-categories, how do I go about fixing this(to make it work for subcategories too), thanks.
Chris M
06-07-2002, 11:59 PM
Thanks...
It works now...
It must be because I copied it straight in, not into a Notepad file first...
Satan
Boofo
06-09-2002, 09:22 PM
How would you do this for the New Posts icon at the left of the forum description where it would only link to the icon if there were new posts in that thread (like they do here on vb.org)?
Originally posted by Lesane
Open root/search.php and find:
// ###################### Start getsearchforums #######################
Add BEFORE it:
// ###################### Start get latest #######################
if ($action=="getlatest") {
// generate query
// do it!
if ($bbuserinfo[userid]!=0 or $bbuserinfo[lastvisit]!=0) {
$forumsql=" AND forumid=$forumid";
// get date:
$datesql=" AND thread.lastpost>=".$bbuserinfo[lastvisit];
$wheresql="1=1".$forumsql.$datesql;
$wheresql.=" AND thread.open<>10";
if ($getsearch=$DB_site->query_first("SELECT searchid FROM search WHERE query='".addslashes($wheresql)."'")) {
$searchid=$getsearch[searchid];
} else {
// get last search for this user and check floodcheck
if ($prevsearch=$DB_site->query_first("SELECT searchid,dateline FROM search WHERE ".iif($bbuserinfo[userid]==0,"ipaddress='$ipaddress'","userid=$bbuserinfo[userid]")." ORDER BY dateline DESC LIMIT 1")) {
if (time()-$prevsearch[dateline]<$searchfloodcheck and $searchfloodcheck!=0) { // and !ismoderator()) {
eval("standarderror(\"".gettemplate("error_pmfloodcheck")."\");");
exit;
}
}
// insert query into db
$DB_site->query("INSERT INTO search (searchid,query,dateline,querystring,showposts,use rid,ipaddress) VALUES (NULL,'".addslashes($wheresql)."',".time().",'".addslashes($query)."',0,$bbuserinfo[userid],'".addslashes($ipaddress)."')");
$searchid=$DB_site->insert_id();
}
eval("standardredirect(\"".gettemplate("redirect_search")."\",\"search.php?s=$session[sessionhash]&action=showresults&getnew=true&searchid=$searchid\");");
} else {
$action="getdaily";
}
}
Now u can use this link to get the results of a specific forum:
search.php?action=getlatest&forumid=XX
Where xx is the forumid.
As you can see on my forum i putted it in the template: "Forum Home Page Templates -> forumhome_forumbit_level1_post & forumhome_forumbit_level2_post with the following code:
<a href="search.php?action=getlatest&&forumid=$forum[forumid]">Read New Posts</a>
Done.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.