The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
vRewrite - SEOed URLs for vBulletin Details »» | |||||||||||||||||||||||||
About
vRewrite is an advance but simple system to rewrite vB's URLs. The rewrite system uses preg_match_all and str_replace to rewrite the URLs. It will rewrite any URLs that are dynamic ex: showthread.php?t= to /the-forum/title-of-the-forum-id.html. Why? SEs (Search Engines) rate results based on filename. Not only that, but most SEs give a "boost" to static URLs (what we do here) versus dynamic URLs. vRewrite accomplishes both of this, for all URLs that a search engine (or a guest) will see. Installation Please download vRewrite.zip and read install.html for more information on how to install it. Requirements vRewrite assumes that you are using Apache with the mod_rewrite module enabled, and running vBulletin 3.5.x. However, if you ask for support here on IIS' module or on vBulletin 3.0.x - I will be more then happy to assist you. Contributions I would like to thank Chroder and Cole for assisting me release vRewrite. I could not have released it if it wasn't for them. I would like to thank the following people/boards for helping beta test vRewrite and making it a better product. Gaming Ultimate, BP Gaming, NBS Designz Cyclez, Hosting-Talk and Forum University. Copyright I've spent many hours working and perfecting vRewrite. The only thing I ask you to do is if you use it, please keep the link back. If you wish to put it in your style instead, simply remove or comment out that line. However, if you use vRewrite you MUST link back. That is the only thing I ask. Known Issues There are no known issues with the latest release (1.0). Support / Issues If you have any problems or discover a bug please post here in this thread. I have also included my email in the install.html email for one-on-one support. The only thing I ask you is please do not post this email address publicly - it is my personal email. Changelog 1.5 Release - vRewrite 1.5 has become stable, and all users under 1.5 RC3 and 1.0 need to upgrade. Support for 1.0 will no longer be offered, and you will be told simply to upgrade. Please continue to keep all bug and feature suggestions on the bug tracker at: Code:
http://www.techhelpforum.com/vrewrite 03/26/06 - Updated the thread to reflect vRewrite 1.5 Beta links. vRewrite files has NOT changed. 03/11/06 - Updated the thread to take advantage of vB.org's new prefix feature. vRewrite itself has NOT changed. 1.0 Release (02/19/06) - I have released the much awaited 1.0. This is the first stable release of vRewrite. All users now should be safe installing vRewrite. For more information, and how to upgrade, please see here. 1.0 Preview (01/12/06) - I have released a preview version of 1.0. This is the final version before 1.0 is considered stable. I believe everything should work in this new preview, but one bug (see known issues). Please see here for more information and how to upgrade. 01/05/06 - Updated ZIP to include a fix for boards running a table prefix. You do not need to upgrade unless you previously had SQL errors. You can upgrade by importing the product and choose "Allow Overwrite". Donations Any donations are very much appreciated! I do this out of my free time and work many hours on it - all for free. Anything to help is always very welcomed If you use vRewrite, please click Install. This helps you keep track of additional upgrades and shows to me that you care about vRewrite You may not post vRewrite ZIP or any files contained in the ZIP on any website. You may not also post any support requests/give support on any website other then this one, without my permission. If you do so, you will get a DMCA for copyright infringement. I do not want this spread to pirated users. Please stop piracy and do not share the source outside of this thread and vB.org/com. Thanks. Support will only be obtained at: https://vborg.vbsupport.ru/forumdisplay.php?f=182 Supporters / CoAuthors Show Your Support
|
Comments |
#432
|
||||
|
||||
Yeah right now I reverted to what was installed with the latest (ie. no error messages but not rewriting) stable version, but here it is:
Global_Complete Code:
if($vbulletin->options['vRewrite_on']) { if($vbulletin->options['vRewrite_forumrewrite'] == "2") { #------------------------------ # Replace Forums #------------------------------ $found = preg_match_all('#<a href="forumdisplay\.php\?f=([0-9]+)"#i', $output, $matches); if($found) { // Build an array of ID's $ids = array(); for($i = 0; $i < $found; $i++) { $fid = $matches[1][$i]; if(!array_key_exists($fid, $vbulletin->forumcache)) continue; $f = $vbulletin->forumcache[$fid]; $fid = $f['forumid']; $title = urlize($f['title']); $output = str_replace("<a href=\"forumdisplay.php?f=$fid\"", "<a href=\"siteforums/$title-$fid.html\"", $output); } } } #------------------------------ # Replace Forums #------------------------------ $found = preg_match_all('#<a href="forumdisplay\.php\?f=([0-9]+)"#i', $output, $matches); if($found) { // Build an array of ID's $ids = array(); for($i = 0; $i < $found; $i++) { $fid = $matches[1][$i]; if(!array_key_exists($fid, $vbulletin->forumcache)) continue; $f = $vbulletin->forumcache[$fid]; $fid = $f['forumid']; $title = urlize($f['title']); $output = str_replace("<a href=\"forumdisplay.php?f=$fid\"", "<a href=\"f-$title-$fid.html\"", $output); } } if($vbulletin->options['vRewrite_memberrewrite'] == "2") { #------------------------------ # Replace User #------------------------------ $found = preg_match_all('#member\.php\?u=([0-9]+)#i', $output, $matches); if($found) { // Build an array of ID's $ids = array(); for($i = 0; $i < $found; $i++) { if(is_numeric($matches[1][$i])) $ids[] = $matches[1][$i]; } $ids = implode(',', $ids); // Go through each $res = $vbulletin->db->query_read("SELECT userid, username FROM " . TABLE_PREFIX . "user WHERE userid='".$vbulletin->db->escape_string($ids)."'"); while($u = $vbulletin->db->fetch_array($res)) { $username = urlize($u['username']); $uid = $u['userid']; $output = str_replace("member.php?u=$uid", "members/$username-$uid.html", $output); } } } #------------------------------ # Replace User #------------------------------ $found = preg_match_all('#member\.php\?u=([0-9]+)#i', $output, $matches); if($found) { // Build an array of ID's $ids = array(); for($i = 0; $i < $found; $i++) { if(is_numeric($matches[1][$i])) $ids[] = $matches[1][$i]; } $ids = implode(',', $ids); // Go through each $res = $vbulletin->db->query_read("SELECT userid, username FROM " . TABLE_PREFIX . "user WHERE userid='".$vbulletin->db->escape_string($ids)."'"); while($u = $vbulletin->db->fetch_array($res)) { $username = urlize($u['username']); $uid = $u['userid']; $output = str_replace("member.php?u=$uid", "u-$username-$uid.html", $output); } } if(THIS_SCRIPT == 'index') { #------------------------------ # Replace showthread.php?goto=newpost #------------------------------ $found = preg_match_all('#<a href="showthread\.php\?goto=newpost&t=([0-9]+)"#i', $output, $matches); if($found) { // Build an array of ID's $ids = array(); for($i = 0; $i < $found; $i++) { if(is_numeric($matches[1][$i])) $ids[] = $matches[1][$i]; } $ids = implode(',', $ids); // Go through each $res = $vbulletin->db->query_read("SELECT threadid, title FROM " . TABLE_PREFIX . "thread WHERE threadid='".$vbulletin->db->escape_string($ids)."'"); while($n = $vbulletin->db->fetch_array($res)) { $title = urlize($n['title']); $tid = $n['threadid']; $output = str_replace("<a href=\"showthread.php?goto=newpost&t=$tid\"", "<a href=\"$title-$tid-newpost.html\"", $output); } } #------------------------------ # Replace showthread.php?goto=lastpost #------------------------------ $found = preg_match_all('#<a href="showthread\.php\?goto=lastpost&t=([0-9]+)"#i', $output, $matches); if($found) { // Build an array of ID's $ids = array(); for($i = 0; $i < $found; $i++) { if(is_numeric($matches[1][$i])) $ids[] = $matches[1][$i]; } $ids = implode(',', $ids); // Go through each $res = $vbulletin->db->query_read("SELECT threadid, title FROM " . TABLE_PREFIX . "thread WHERE threadid='".$vbulletin->db->escape_string($ids)."'"); while($n = $vbulletin->db->fetch_array($res)) { $title = urlize($n['title']); $tid = $n['threadid']; $output = str_replace("<a href=\"showthread.php?goto=lastpost&t=$tid\"", "<a href=\"$title-$tid-lastpost.html\"", $output); } } } if(THIS_SCRIPT == 'forumdisplay' OR 'index') { #------------------------------ # Replace Last Post User (Forum) #------------------------------ $found = preg_match_all('#<a href="member\.php\?find=lastposter&f=([0-9]+)"#i', $output, $matches); if($found) { // Build an array of ID's $ids = array(); for($i = 0; $i < $found; $i++) { if(is_numeric($matches[1][$i])) $ids[] = $matches[1][$i]; } $ids = implode(',', $ids); // Go through each $res = $vbulletin->db->query_read("SELECT f.forumid, u.userid, u.username FROM " . TABLE_PREFIX . "forum f, " . TABLE_PREFIX . "user u WHERE forumid='".$vbulletin->db->escape_string($ids)."' AND u.username = f.lastposter"); while($f = $vbulletin->db->fetch_array($res)) { $lp = urlize($f['username']); $lpid = $f['userid']; $fid = $f['forumid']; $output = str_replace("<a href=\"member.php?find=lastposter&f=$fid\"", "<a href=\"u-$lp-$lpid.html\"", $output); } } } if(THIS_SCRIPT == 'forumdisplay') { #------------------------------ # Replace Last Post User (Thread) #------------------------------ $found = preg_match_all('#<a href="member\.php\?find=lastposter&t=([0-9]+)"#i', $output, $matches); if($found) { // Build an array of ID's $ids = array(); for($i = 0; $i < $found; $i++) { if(is_numeric($matches[1][$i])) $ids[] = $matches[1][$i]; } $ids = implode(',', $ids); // Go through each $res = $vbulletin->db->query_read("SELECT f.forumid, u.userid, u.username FROM " . TABLE_PREFIX . "forum f, " . TABLE_PREFIX . "user u WHERE forumid='".$vbulletin->db->escape_string($ids)."' AND u.username = f.lastposter"); while($f = $vbulletin->db->fetch_array($res)) { $lp = $f['lastposter']; $lp = urlize($f['username']); $lpid = $f['userid']; $tid = $f['threadid']; $output = str_replace("<a href=\"member.php?find=lastposter&t=$tid\"", "<a href=\"u-$lp-$lpid.html\"", $output); } } } #----------------------------------- # DO NOT REMOVE OTHERWISE YOU # WILL BE SENT A DMCA FOR COPYRIGHT # INFRINGEMENT YOU MAY NOT USE THIS # PLUGIN WITHOUT THIS LINE OF CODE # IF YOU WISE TO REMOVE THIS AND # ADD IT TO YOUR STYLE, FEEL FREE # AS LONG AS THE COPYRIGHT REMAINS #----------------------------------- $output = str_replace("</body>",'<div align="center" class="smallfont">SEOed URLs completed by <a href="http://www.techhelpforum.com">Tech Help Forum</a>.</div></body>',$output); if($vbulletin->options['vRewrite_showthreadrewrite'] == "2") { #------------------------------ # SHOWTHREAD #------------------------------ $found = preg_match_all('#<a href="showthread\.php\?t=([0-9]+)"#i', $output, $matches); if($found) { // Build an array of ID's $ids = array(); for($i = 0; $i < $found; $i++) { if(is_numeric($matches[1][$i])) $ids[] = $matches[1][$i]; } $ids = implode(',', $ids); // Go through each $res = $vbulletin->db->query_read("SELECT threadid, forumid, title FROM " . TABLE_PREFIX . "thread WHERE threadid='".$vbulletin->db->escape_string($ids)."'"); while($t = $vbulletin->db->fetch_array($res)) { $title = urlize($t['title']); $tid = $t['threadid']; $fid = $t['forumid']; $foruminfo = $vbulletin->forumcache[$fid]; $fname = urlize($foruminfo['title']); $fname = str_replace("-","",$fname); $title = str_replace("-"," ",$title); $output = str_replace("<a href=\"showthread.php?t=$tid\"", "<a href=\"$fname/$title-$tid.html\"", $output); } } } #------------------------------ # SHOWTHREAD #------------------------------ $found = preg_match_all('#<a href="showthread\.php\?t=([0-9]+)"#i', $output, $matches); if($found) { // Build an array of ID's $ids = array(); for($i = 0; $i < $found; $i++) { if(is_numeric($matches[1][$i])) $ids[] = $matches[1][$i]; } $ids = implode(',', $ids); // Go through each $res = $vbulletin->db->query_read("SELECT threadid, forumid, title FROM " . TABLE_PREFIX . "thread WHERE threadid='".$vbulletin->db->escape_string($ids)."'"); while($t = $vbulletin->db->fetch_array($res)) { $title = urlize($t['title']); $tid = $t['threadid']; $fid = $t['forumid']; $foruminfo = $vbulletin->forumcache[$fid]; $fname = urlize($foruminfo['title']); $output = str_replace("<a href=\"showthread.php?t=$tid\"", "<a href=\"$fname/t-$title-$tid.html\"", $output); } } #------------------------------ # SHOWTHREAD and page #------------------------------ $found = preg_match_all('#showthread\.php\?t=([0-9]+)&page=([0-9]+)#i', $output, $matches); if($found) { // Build an array of ID's $ids = array(); // Keep track of page nums that go with tid's $temp = array(); for($i = 0; $i < $found; $i++) { // $temp[<threadid>] = <page> $temp[ $matches[1][$i] ] = $matches[2][$i]; if(is_numeric($matches[1][$i])) $ids[] = $matches[1][$i]; } $ids = implode(',', $ids); // Go through each $res = $vbulletin->db->query_read("SELECT threadid, forumid, title FROM " . TABLE_PREFIX . "thread WHERE threadid='".$vbulletin->db->escape_string($ids)."'"); while($t = $vbulletin->db->fetch_array($res)) { $title = urlize($t['title']); $tid = $t['threadid']; $fid = $t['forumid']; $foruminfo = $vbulletin->forumcache[$fid]; $fname = urlize($foruminfo['title']); $page = $temp[$tid]; $output = str_replace("showthread.php?t=$tid&page=$page", "$fname/t-$title-$tid-page-$page.html", $output); } } if(THIS_SCRIPT == 'showthread') { #------------------------------ # showpost #------------------------------ $found = preg_match_all('#<a href="showpost\.php\?p=([0-9]+)&postcount=([0-9]+)"#i', $output, $matches); if($found) { // Build an array of ID's $ids = array(); for($i = 0; $i < $found; $i++) { $temp[ $matches[1][$i] ] = $matches[2][$i]; if(is_numeric($matches[1][$i])) $ids[] = $matches[1][$i]; } $ids = implode(',', $ids); // Go through each $res = $vbulletin->db->query_read("SELECT postid, title FROM " . TABLE_PREFIX . "post WHERE postid='".$vbulletin->db->escape_string($ids)."'"); while($p = $vbulletin->db->fetch_array($res)) { $pid = $p['postid']; $postcount = $temp[$pid]; $output = str_replace("<a href=\"showpost.php?p=$pid&postcount=$postcount\"", "<a href=\"p-$pid.html\"", $output); } } #------------------------------ # Print SHOWTHREAD #------------------------------ $found = preg_match_all('#<a href="printthread\.php\?t=([0-9]+)"#i', $output, $matches); if($found) { // Build an array of ID's $ids = array(); for($i = 0; $i < $found; $i++) { if(is_numeric($matches[1][$i])) $ids[] = $matches[1][$i]; } $ids = implode(',', $ids); // Go through each $res = $vbulletin->db->query_read("SELECT threadid, title FROM " . TABLE_PREFIX . "thread WHERE threadid='".$vbulletin->db->escape_string($ids)."'"); while($t = $vbulletin->db->fetch_array($res)) { $title = urlize($t['title']); $tid = $t['threadid']; $output = str_replace("<a href=\"printthread.php?t=$tid\"", "<a href=\"print-$title-$tid.html\"", $output); } } #------------------------------ # Email SHOWTHREAD #------------------------------ $found = preg_match_all('#<a href="sendmessage\.php\?do=sendtofriend&t=([0-9]+)"#i', $output, $matches); if($found) { // Build an array of ID's $ids = array(); for($i = 0; $i < $found; $i++) { if(is_numeric($matches[1][$i])) $ids[] = $matches[1][$i]; } $ids = implode(',', $ids); // Go through each $res = $vbulletin->db->query_read("SELECT threadid, title FROM " . TABLE_PREFIX . "thread WHERE threadid='".$vbulletin->db->escape_string($ids)."'"); while($t = $vbulletin->db->fetch_array($res)) { $title = urlize($t['title']); $tid = $t['threadid']; $output = str_replace("<a href=\"sendmessage.php?do=sendtofriend&t=$tid\"", "<a href=\"sendtofriend-$title-$tid.html\"", $output); } } #------------------------------ # Prev/Next Threads #------------------------------ $found = preg_match_all('#<a href="showthread\.php\?t=([0-9]+)&goto=nextnewest"#i', $output, $matches); if($found) { // Build an array of ID's $ids = array(); for($i = 0; $i < $found; $i++) { if(is_numeric($matches[1][$i])) $ids[] = $matches[1][$i]; } $ids = implode(',', $ids); // Go through each $res = $vbulletin->db->query_read("SELECT threadid, title, forumid FROM " . TABLE_PREFIX . "thread WHERE threadid='".$vbulletin->db->escape_string($ids)."'"); while($t = $vbulletin->db->fetch_array($res)) { $tid = $t['threadid']; $title = urlize($t['title']); $fid = $t['forumid']; $f = $vbulletin->forumcache[$fid]; $fname = urlize($f['title']); $output = str_replace("<a href=\"showthread.php?t=$tid&goto=nextnewest\"", "<a href=\"$fname/$title-$tid-nextnewest.html\"", $output); } } #------------------------------ # Prev/Next Threads #------------------------------ $found = preg_match_all('#<a href="showthread\.php\?t=([0-9]+)&goto=nextoldest"#i', $output, $matches); if($found) { // Build an array of ID's $ids = array(); for($i = 0; $i < $found; $i++) { if(is_numeric($matches[1][$i])) $ids[] = $matches[1][$i]; } $ids = implode(',', $ids); // Go through each $res = $vbulletin->db->query_read("SELECT threadid, title, forumid FROM " . TABLE_PREFIX . "thread WHERE threadid='".$vbulletin->db->escape_string($ids)."'"); while($t = $vbulletin->db->fetch_array($res)) { $tid = $t['threadid']; $title = urlize($t['title']); $fid = $t['forumid']; $f = $vbulletin->forumcache[$fid]; $fname = urlize($f['title']); $output = str_replace("<a href=\"showthread.php?t=$tid&goto=nextoldest\"", "<a href=\"$fname/$title-$tid-nextoldest.html\"", $output); } } } #------------------------------ # New Thread #------------------------------ $found = preg_match_all('#<a href="newthread\.php\?do=newthread&f=([0-9]+)"#i', $output, $matches); if($found) { // Build an array of ID's $ids = array(); for($i = 0; $i < $found; $i++) { if(is_numeric($matches[1][$i])) $ids[] = $matches[1][$i]; } $ids = implode(',', $ids); // Go through each $res = $vbulletin->db->query_read("SELECT forumid, title FROM " . TABLE_PREFIX . "forum WHERE forumid='".$vbulletin->db->escape_string($ids)."'"); while($f = $vbulletin->db->fetch_array($res)) { $title = urlize($f['title']); $fid = $f['forumid']; $output = str_replace("<a href=\"newthread.php?do=newthread&f=$fid\"", "<a href=\"$title-$fid/newthread.php\"", $output); } } #------------------------------ # New Post #------------------------------ $found = preg_match_all('#<a href="newreply\.php\?do=newreply&noquote=1&p=([0-9]+)"#i', $output, $matches); if($found) { // Build an array of ID's $ids = array(); for($i = 0; $i < $found; $i++) { if(is_numeric($matches[1][$i])) $ids[] = $matches[1][$i]; } $ids = implode(',', $ids); // Go through each $res = $vbulletin->db->query_read("SELECT p.threadid, p.postid, t.title, t.forumid FROM " . TABLE_PREFIX . "post p, " . TABLE_PREFIX . "thread t WHERE p.postid='".$vbulletin->db->escape_string($ids)."' AND t.threadid = p.threadid"); while($t = $vbulletin->db->fetch_array($res)) { $tid = $t['threadid']; $pid = $t['postid']; $title = urlize($t['title']); $fid = $t['forumid']; $f = $vbulletin->forumcache[$fid]; $fname = urlize($f['title']); $output = str_replace("<a href=\"newreply.php?do=newreply&noquote=1&p=$pid\"", "<a href=\"$fname/newpostnoquote-$pid.php\"", $output); } } #------------------------------ # New Post #------------------------------ $found = preg_match_all('#<a href="newreply\.php\?do=newreply&p=([0-9]+)"#i', $output, $matches); if($found) { // Build an array of ID's $ids = array(); for($i = 0; $i < $found; $i++) { if(is_numeric($matches[1][$i])) $ids[] = $matches[1][$i]; } $ids = implode(',', $ids); // Go through each $res = $vbulletin->db->query_read("SELECT p.threadid, p.postid, t.title, t.forumid FROM " . TABLE_PREFIX . "post p, " . TABLE_PREFIX . "thread t WHERE p.postid='".$vbulletin->db->escape_string($ids)."' AND t.threadid = p.threadid"); while($t = $vbulletin->db->fetch_array($res)) { $tid = $t['threadid']; $pid = $t['postid']; $title = urlize($t['title']); $fid = $t['forumid']; $f = $vbulletin->forumcache[$fid]; $fname = urlize($f['title']); $output = str_replace("<a href=\"newreply.php?do=newreply&p=$pid\"", "<a href=\"$fname/newpost-$pid.php\"", $output); } } #------------------------------ # Search #------------------------------ $found = preg_match_all('#<a href="search\.php\?searchid=([0-9]+)"#i', $output, $matches); if($found) { // Build an array of ID's $ids = array(); for($i = 0; $i < $found; $i++) { if(is_numeric($matches[1][$i])) $ids[] = $matches[1][$i]; } $ids = implode(',', $ids); // Go through each $res = $vbulletin->db->query_read("SELECT userid, searchid FROM " . TABLE_PREFIX . "search WHERE searchid='".$vbulletin->db->escape_string($ids)."'"); while($s = $vbulletin->db->fetch_array($res)) { $userid = $s['userid']; $searchid = $s['searchid']; $output = str_replace("search.php?searchid=$searchid", "search-$userid-$searchid.html", $output); } } if(THIS_SCRIPT == 'memberlist') { #------------------------------ # Memberlist #------------------------------ $found = preg_match_all('#<a href="memberlist\.php\?ltr=([A-Z]+)&pp=0&sort=username&order=asc"#i', $output, $matches); if($found) { // Build an array of ID's $ids = array(); for($i = 0; $i < $found; $i++) { if(is_numeric($matches[1][$i])) $ids[] = $matches[1][$i]; $ltr = $matches[1][$i]; $output = str_replace("<a href=\"memberlist.php?ltr=$ltr&pp=0&sort=username&order=asc\"", "<a href=\"memberlist-$ltr-0-username-asc.html\"", $output); } $ids = implode(',', $ids); } } if(THIS_SCRIPT == 'forumdisplay') { #------------------------------ # Forum Pages #------------------------------ $found = preg_match_all('#forumdisplay\.php\?f=([0-9]+)&page=([0-9]+)&order=desc#i', $output, $matches); if($found) { // Build an array of ID's $ids = array(); // Keep track of page nums that go with fid's $temp = array(); for($i = 0; $i < $found; $i++) { // $temp[<forumid>] = <page> $temp[ $matches[1][$i] ] = $matches[2][$i]; if(is_numeric($matches[1][$i])) $ids[] = $matches[1][$i]; } $ids = implode(',', $ids); // Go through each $res = $vbulletin->db->query_read("SELECT title, forumid FROM " . TABLE_PREFIX . "forum WHERE forumid IN($ids)"); while($f = $vbulletin->db->fetch_array($res)) { $title = urlize($f['title']); $fid = $f['forumid']; $page = $temp[$fid]; $output = str_replace("forumdisplay.php?f=$fid&page=$page&order=desc", "f-$title-desc-$page.html", $output); } } } #------------------------------ # misc pages #------------------------------ $output = str_replace("search.php?do=getnew","search-getnew.html",$output); $output = str_replace("search.php?do=getdaily","search-getdaily.html",$output); $output = str_replace("forumdisplay.php?do=markread","markread.html",$output); } /** * Turn a string into a URL friendly string * * @param string $txt The string to work on * @return string The new string */ function urlize($txt) { $txt = unaccent($txt); $txt = html_entity_decode($txt); $txt = str_replace(' ', '-', $txt); $txt = preg_replace('#[^a-zA-Z0-9_\-]+#', '', $txt); $txt = preg_replace('#[\-]+#', '-', $txt); return strtolower($txt); } /** * Turn accented characters into normal characters * * @param string $txt The string to remove the accents from * @return string Your new clean string */ function unaccent($txt) { $trans = get_html_translation_table(HTML_ENTITIES); foreach($trans as $literal => $entity) { if(ord($literal) >= 192) { $search[] = $literal; $replace[] = substr($entity, 1, 1); } } return str_replace($search, $replace, $txt); } |
#433
|
||||
|
||||
The problem is i can't add the following code to my styles :-(
Code:
<if THIS_SCRIPT != 'index'> <base href="$vboptions[bburl]/" /> </if> , load average: 11.67, 9.81, 8.45 |
#434
|
|||
|
|||
yayvb -> I'll look into it...it should work.
bchawla -> Let me double check, but I thought that was right :S |
#435
|
||||
|
||||
Quote:
its wierd -- if I attempt to add that code to a a style from vbDesigns.de, it adds the code fine HOwever, if I add the code to a vb default style, it freezes My serv er loads are really high now, not dropping- i dont want to reboot the server - I am hopng Rackspace can fix the issue (w/o reboot) |
#436
|
|||
|
|||
Ah, got it.
Code:
<if condition="THIS_SCRIPT != 'index'"> <base href="$vboptions[bburl]/" /> </if> |
#437
|
||||
|
||||
Quote:
|
#438
|
|||
|
|||
Thanks for that...I thought I had it correct, but apprently not.
Updated ZIP as well. |
#439
|
||||
|
||||
Eek, let me get back to you in a few minutes. Apparently this time I saved the files into a directory called newvrewrite and last time I saved them into a directory called vrewrite-new so this time when I saw that my .htaccess anx .xml was the same, it was because I am importing everything from before!!!
Let me give the "New" LMAO files a whirl and I'll let you know what I find!! lol But I am having trouble with adding the above little code snipet to the headinclude template. It times out or whatever and then I see no change. |
#440
|
||||
|
||||
Everything on the front page looked good, but I just noticed the links on the front are being rewritten properly, but when you click on them you don't go to where it says you should go, you end up at a different random topic altogether. I just disabled so don't go for a reference, but when you hover a link it shows a valid rewritten .html url, but when you click it it brings you to different ones, but not the right one.
*EDIT* I am very excited that it looks like it will be working for me soon!! I have a feeling it's not just me or my server where the links are going to the wrong places. It looks like maybe only the the thread links on forumhome |
#441
|
|||
|
|||
Quote:
Quote:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|