Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by (Guest)
Developer Last Online: Jan 1970 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 06-13-2000 Last Update: Never Installs: 0
 
No support by the author.

I've created an alternative hack to the existing one which generated lots of little files. This one's a lot less system intensive and it doesn't involve static files, which means that you save A LOT of web space.

However, this will only work on Linux systems. (contact me if you have access to your httpd.conf on another OS, and I'll make code alterations for it to work)

Ed and I tested this (thanks a bunch, Ed!) and everything seems to be working great!

Check out his archive at:
http://www.magic-singles.com/cpa/forums/search.php3

Directly in the vB directory, create an .htaccess containing:

<Files search>
DirectoryIndex search
ForceType application/x-httpd-php3
</Files>

Then, create a file called "search" in the vB directory containing:

<?
$searcharray=explode("/",$REQUEST_URI);
$searchcount=count($searcharray);

$spec = $searchcount - 1;

$threadid = $searcharray[$spec];
require("showthread.php");
?>

Finally, create a file in your existing vB directory called search.php3 containing:

<?
require("global.php");

mysql_pconnect($server,$user,$password);
mysql_select_db($database);

$threads=$DB_site->query("SELECT threadid,title FROM thread WHERE visible=1 ORDER BY lastpost DESC");
while ($threadarray = $DB_site->fetch_array($threads)) {
$threadid = $threadarray["threadid"];
$title = $threadarray["title"];
print "<a href=\"search/$threadid\">$title</a><br>\n";
}
?>

Finally, create a line in the cssinclude section of the CP which reads:

<base href="http://yoursite.com/forums/">

and replace yoursite.com/forums/ with the domain + directory that vB is located in.

All should work well!

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 06-27-2000, 06:50 AM
Guest
 
Posts: n/a
Default

Quote:
Originally posted by Cold Steel
Will this work for FreeBSD?
Yes, it does.

http://www.aikiweb.com/forums/engine.php

Running on FreeBSD 4.0-stable, Apache 1.3.12, mySQL 3.22.32, and PHP 4.0.
Reply With Quote
  #13  
Old 06-27-2000, 11:03 AM
Guest
 
Posts: n/a
Default

TB2: Yes.. just change your sql statement in the search.php3 you created to read:

SELECT threadid,title FROM thread WHERE visible=1 and forumid != BADFORUMID1 and forumid != BADFORUMID2 ORDER BY lastpost DESC

Replace BADFORUMID1 and BADFORUMID2, etc. with the forum id's that you do not want to be indexed.
Reply With Quote
  #14  
Old 06-27-2000, 11:15 AM
Guest
 
Posts: n/a
Default

Stallion: I was just looking through the global.php file and it's not necessary for you to issue the mysql_pconnect() or mysql_select_db() calls at the top of search.php3. A database connection is already created inside of global.php.

Also, just to clarify for everyone.. search.php3 can be any filename you wish. I named it to search_hack.php myself since we already had a search.php file we were using.

And lastly.. it's a drain on the server to use .htaccess files... those apache directives could just as easily be put inside of a set of Directory tags in the main httpd.conf file. Apache will be all the faster for it.

i.e.
Code:
<Directory /www/sitename/forums/>
?  <Files search> 
    DirectoryIndex search 
    ForceType application/x-httpd-php
  </Files>
</Directory>
Also, for those of you using php4, as I am, notice that my ForceType directive does not end in php3 as in Stallion's example. PHP4 uses application/x-httpd-php instead.

Stallion: great hack.. thanks.
Reply With Quote
  #15  
Old 06-27-2000, 03:56 PM
Guest
 
Posts: n/a
Default

Including the "<base href="forums/URL"> in the $sccinclude messes up the forums for Netscape users. For example, when they went to my board, they would see the link for a forum as "http://forumdisplay.php?yadda-yadda". I've taken it out and it works fine now, but unfortunatly the search page doesn't work anymore. What should I do to remedy this?
Reply With Quote
  #16  
Old 06-28-2000, 12:20 AM
Guest
 
Posts: n/a
Default

cool, i would like to have this setup and would need some guidance...

i am new to linux, new to dedicated server use and new to vbulletin... should i be messing around with it right now ?
Reply With Quote
  #17  
Old 06-28-2000, 01:34 AM
Guest
 
Posts: n/a
Default

Quote:
Originally posted by JimF
Including the "<base href="forums/URL"> in the $sccinclude messes up the forums for Netscape users. For example, when they went to my board, they would see the link for a forum as "http://forumdisplay.php?yadda-yadda". I've taken it out and it works fine now, but unfortunatly the search page doesn't work anymore. What should I do to remedy this?
That's odd. I don't see this behavior on my board when I look at it using Netscape and I've implemented the hack. Am I looking at it correctly?

My board: http://www.aikiweb.com/forums/
The hack: http://www.aikiweb.com/forums/engine.php
Reply With Quote
  #18  
Old 07-05-2000, 10:00 PM
Guest
 
Posts: n/a
Default

This is cool is there any simple way to create more of a structure. IE

Main Page:

Forum 1
|_ New Page With Posts XX Per Page

Forum 2
|_ New Page With Posts XX Per Page

Forum 3
|_ New Page With Posts XX Per Page

Just an idea...
Reply With Quote
  #19  
Old 07-05-2000, 10:25 PM
Guest
 
Posts: n/a
Default

Quote:
Originally posted by BassWriters
My question was if from experience, the search engines actually index every thread, or if they ignore the page because there are too many links and not enough text.
Its been done this way for other forums/news scripts, so I'd imagine its the preferred method and will work fine with spiders.
Reply With Quote
  #20  
Old 07-05-2000, 10:30 PM
Guest
 
Posts: n/a
Default

1) Listen to danbeck...he speaks the truth
2) JimF, it should be the full URL, nothing relative
3) eva2000, as long as you don't overwrite any existing files, no harm can be done
4) Brian: not sure what you mean...
Reply With Quote
  #21  
Old 07-05-2000, 10:37 PM
Guest
 
Posts: n/a
Default

What I meant was for the main page to have links to the fourms, and then the page that shows the links for that forum have it make a new page for every 50 or so topics.

For example say the main page would have a link to each forum and then the page with the posts for each forum would show xxx topics per page then link to the next page that way if you have a big forum you dont have thousands of links all on one page
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:56 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.07100 seconds
  • Memory Usage 2,276KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete