vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   mod_rewrite (https://vborg.vbsupport.ru/showthread.php?t=95922)

kfiasche81 09-08-2005 09:00 PM

mod_rewrite
 
figured it was about time I updated my mod_rewrite tutorial for vBulletin. Therefore, I decided to provide you guys with the exact, full mod_rewrite that I use here at DaniWeb. It's written for a clean install of vB 3.0.7. This version is not for the faint of heart!

Some new features you can expect to find in this version, that aren't in previous versions, included multi-page support, support for linear, hybrid, and threaded thread modes, full support in the who's online (no more Unknown Locations!), previous / next thread links, and much more!

Attached is my massive .htaccess file. Rename it .htaccess and upload it to your forum directory. Also attached is an .xml file that contains all of the templates that need to be changed. They are already fully edited. Use the vB Admin Panel to create a new style out of the attached XML file. Then, simply edit it as you'd like. However, for the most part, CSS customizations will do - most of what I accomlish at DaniWeb is mere changing the CSS and the header and footer templates.

Below are the PHP files that need to be edited. You will notice two lines at a time. The first line represents what to search for, and the second line represents what to replace it with.

So without further ado ...

forumdisplay.php

Code:

$navbits["forumdisplay.php?$session[sessionurl]f=$forumID"] = $forumTitle;
$navbits["forum$forumID.html"] = $forumTitle; // edited by Dani

$announcementidlink = iif(!$vboptions['oneannounce'] , "&announcementid=$announcement[announcementid]");
$announcementidlink = iif(!$vboptions['oneannounce'] , "-$announcement[announcementid]");

$pagenav = construct_page_nav($totalthreads, "forumdisplay.php?$session[sessionurl]f=$forumid", "&sort=$sortfield&order=$sortorder&pp=$perpage&daysprune=$daysprune");
$pagenav = construct_page_nav($totalthreads, "forum$forumid", "-$sortfield-$sortorder-$perpage-$daysprune.html");


search.php

Code:

$highlightwords = '&highlight=' . urlencode(implode(' ', $display['highlight']));
$highlightwords = '-' . urlencode(implode(' ', $display['highlight']));

$display['forums']["$key"] = "<a href=\"forumdisplay.php?$session[sessionurl]f=$forumid\"><b><u>" . $forumcache["$forumid"]['title'] . '</u></b></a>';
$display['forums']["$key"] = "<a href=\"forum$forumid.html\"><b><u>" . $forumcache["$forumid"]['title'] . '</u></b></a>';


showthread.php

Code:

$highlightwords = iif($goto, '&', '&amp;') . 'highlight=' . urlencode($_GET['highlight']);
$highlightwords = '-' . urlencode($_GET['highlight']);

    exec_header_redirect("showthread.php?$session[sessionurl_js]p=$getlastpost[postid]$highlightwords#post$getlastpost[postid]");
    exec_header_redirect("threadedpost$getlastpost[postid]$highlightwords.html#post$getlastpost[postid]");

exec_header_redirect("showthread.php?$session[sessionurl_js]p=$posts[postid]$highlightwords#post$posts[postid]");
exec_header_redirect("threadedpost$posts[postid]$highlightwords.html#post$posts[postid]");

exec_header_redirect("showthread.php?$session[sessionurl_js]t=$threadinfo[threadid]&goto=lastpost$highlightwords");
exec_header_redirect("lastpostinthread$threadinfo[threadid]$highlightwords.html");

exec_header_redirect("showthread.php?$session[sessionurl_js]t=$thread[pollid]");
exec_header_redirect("thread$thread[pollid].html");

$pagenav = construct_page_nav($totalposts, "showthread.php?$session[sessionurl]t=$threadid", "&amp;pp=$perpage$highlightwords");
$pagenav = construct_page_nav($totalposts, "threadnav$threadid", "-$perpage$highlightwords.html");

$firstunread = 'showthread.php?' . $session['sessionurl'] . 't=' . $threadid . '&goto=newpost';
$firstunread = 'newpostinthread' . $threadid . '.html';

$pagenav = construct_page_nav($numhybrids, "showthread.php?$session[sessionurl]p=$_REQUEST[postid]", "&amp;pp=$perpage$highlightwords");
$pagenav = construct_page_nav($numhybrids, "post$_REQUEST[postid]", "-$perpage$highlightwords.html");

$navbits["forumdisplay.php?$session[sessionurl]f=$forumID"] = $forumTitle;
$navbits["forum$forumID.html"] = $forumTitle;


clientscript/vbulletin_thrdpostlist.js

Code:

window.location = "showthread.php?" + SESSIONURL + "postid=" + postid + "#poststop";
window.location = "post" + postid + ".html#poststop";

document.write('<a href="showthread.php?postid=' + postid + highlightwords + '#post' + postid + '" id="link' + postid + '"><i>' + morephrase + '</i></a></div>\n');
document.write('<a href="threadedpost' + postid + highlightwords + '.html#post' + postid + '" id="link' + postid + '"><i>' + morephrase + '</i></a></div>\n');

document.write('<a href="showthread.php?postid=' + postid + highlightwords + '#post' + postid + '" onclick="return showPost(' + postid + ')" id="link' + postid + '"' + titlestyle + '>' + title + '</a> ');
document.write('<a href="threadedpost' + postid + highlightwords + '.html#post' + postid + '" onclick="return showPost(' + postid + ')" id="link' + postid + '"' + titlestyle + '>' + title + '</a> ');


includes/functions_forumdisplay.php

Code:

$address = "showthread.php?$session[sessionurl]t=$thread[threadid]";
$address = "threadnav$thread[threadid]";

$address2 = "$thread[highlight]";
$address2 = "-$vboptions[maxposts]$thread[highlight].html";

includes/functions_online.php

Code:

$userinfo['where'] = "<a href=\"showthread.php?$session[sessionurl]t=$threadid\" title=\"$threadpreview\">$threadtitle</a>";
    $userinfo['where'] = "<a href=\"thread$threadid.html\" title=\"$threadpreview\">$threadtitle</a>";

    $userinfo['where'] = "<a href=\"showthread.php?$session[sessionurl]p=$postid#postid=$postid\" title=\"$threadpreview\">$threadtitle</a>";
    $userinfo['where'] = "<a href=\"post$postid.html#post$postid\" title=\"$threadpreview\">$threadtitle</a>";

$userinfo['where'] = "<a href=\"forumdisplay.php?$session[sessionurl]f=$forumid\">$forumtitle</a>";
$userinfo['where'] = "<a href=\"forum$forumid.html\">$forumtitle</a>";


Also, in functions_online.php, after
Code:

$userinfo['values'] = $values;
insert

Code:

// added by dani for seo hack
if (eregi("thread([0-9]+).html$", $filename, $tmatch))
{
$filename = 'showthread.php';
$values['threadid'] = $tmatch[1];
}

if (eregi("forum([0-9]+).html$", $filename, $fmatch))
{
$filename = 'forumdisplay.php';
$values['forumid'] = $fmatch[1];
}

if (eregi("post([0-9]+).html$", $filename, $pmatch))
{
$filename = 'showthread.php';
$values['postid'] = $pmatch[1];
}
if (eregi("post([0-9]+).html#post([0-9]+)$", $filename, $pmatch))
{
$filename = 'showthread.php';
$values['postid'] = $pmatch[1];
}
// added by dani for seo hack

TNX to dani..

bigcurt 09-09-2005 05:43 PM

Umm, first I believe this has already been released, also did you ask Dani before releasing her code here? I just wanted to make sure, so just tell me.

~Curt

GoTTi 09-10-2005 12:21 AM

whats this do?

djr 09-10-2005 09:34 AM

- edit: Sorry, was being stupid.
Quote:

Originally Posted by GoTTi
whats this do?

This is for SEO purposes. It's essentialy serving search engine spiders static url's rich with (high) keyword density.

italks 09-17-2005 04:48 PM

will this work on vBulletin 3.0.6 ???


All times are GMT. The time now is 12:49 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.01670 seconds
  • Memory Usage 1,740KB
  • 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
  • (8)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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