vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Need help finding this hack (https://vborg.vbsupport.ru/showthread.php?t=39312)

Carthriller 06-01-2002 03:53 PM

Need help finding this hack
 
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/showthrea...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?

PET 06-01-2002 06:56 PM

Some screenshots ?

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:

PHP Code:

// ###################### Start getsearchforums ####################### 

Add BEFORE it:

PHP Code:

// ###################### Start get latest #######################
if ($action=="getlatest") {
  
// generate query
  // do it!
  
if ($bbuserinfo[userid]!=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,userid,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:

PHP Code:

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:

PHP 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...

PHP Code:

$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 <[url]http://www.php.net/addslashes[/url]>($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

Quote:

Originally posted by hellsatan
Here are the lines...

PHP Code:

$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 <[url]http://www.php.net/addslashes[/url]>($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

Quote:

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)?

Quote:

Originally posted by Lesane
Open root/search.php and find:

PHP Code:

// ###################### Start getsearchforums ####################### 

Add BEFORE it:

PHP Code:

// ###################### Start get latest #######################
if ($action=="getlatest") {
  
// generate query
  // do it!
  
if ($bbuserinfo[userid]!=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,userid,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:

PHP Code:

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:

PHP Code:

<a href="search.php?action=getlatest&&forumid=$forum[forumid]">Read New Posts</a

Done.



All times are GMT. The time now is 03:51 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01275 seconds
  • Memory Usage 1,825KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (10)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (19)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete