Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Heavy bug on Lyrics site
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #4
RE: Heavy bug on Lyrics site
You can try this edit to inc/xthreads/xt_forumdhooks.php

Replace

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
		$filterargs_html = htmlspecialchars_uni($xthreads_forum_filter_args);
		$GLOBALS['sorturl'] .= $filterargs_html;
		
		// inject URL into multipage - template cache hacks
		global $templates;
		$tpls = array('multipage_end', 'multipage_nextpage', 'multipage_page', 'multipage_prevpage', 'multipage_start');
		foreach($tpls as &$t)
			if(!isset($templates->cache[$t])) {
				$templates->cache(implode(',', $tpls));
				break;
			}
		
		// may need to replace first & with a ?
		if(($mybb->settings['seourls'] == 'yes' || ($mybb->settings['seourls'] == 'auto' && $_SERVER['SEO_SUPPORT'] == 1)) && $GLOBALS['sortby'] == 'lastpost' && $GLOBALS['sortordernow'] == 'desc' && ($GLOBALS['datecut'] <= 0 || $GLOBALS['datecut'] == 9999))
			$filterargs_html = '?'.substr($filterargs_html, 5);
		
		foreach($tpls as &$t) {
			$templates->cache[$t] = str_replace('{$page_url}', '{$page_url}'.$filterargs_html, $templates->cache[$t]);
		}

with

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
		// if Google SEO is active, force our URL into that
		if(function_exists('google_seo_url_cache')) {
			// force cache load
			$gsurl = google_seo_url_cache(GOOGLE_SEO_FORUM, $foruminfo['fid']);
			if(strpos($gsurl, '?') !== false)
				$gsurl .= $xthreads_forum_filter_args;
			else
				$gsurl .= '?'.substr($xthreads_forum_filter_args, 1);
			// pollute Google SEO's cache with our param
			$GLOBALS['google_seo_url_cache'][GOOGLE_SEO_FORUM][$foruminfo['fid']] = $gsurl;
		} else {
			// use standard multipage template hack
			$filterargs_html = htmlspecialchars_uni($xthreads_forum_filter_args);
			$GLOBALS['sorturl'] .= $filterargs_html;
			
			// inject URL into multipage - template cache hacks
			global $templates;
			$tpls = array('multipage_end', 'multipage_nextpage', 'multipage_page', 'multipage_prevpage', 'multipage_start');
			foreach($tpls as &$t)
				if(!isset($templates->cache[$t])) {
					$templates->cache(implode(',', $tpls));
					break;
				}
			
			// may need to replace first &amp; with a ?
			if(($mybb->settings['seourls'] == 'yes' || ($mybb->settings['seourls'] == 'auto' && $_SERVER['SEO_SUPPORT'] == 1)) && $GLOBALS['sortby'] == 'lastpost' && $GLOBALS['sortordernow'] == 'desc' && ($GLOBALS['datecut'] <= 0 || $GLOBALS['datecut'] == 9999)) //  && (strpos(FORUM_URL_PAGED, '{page}') === false) - somewhat unsupported, since MyBB hard codes the page 1 elimination behaviour
				$filterargs_html = '?'.substr($filterargs_html, 5);
			
			foreach($tpls as &$t) {
				$templates->cache[$t] = str_replace('{$page_url}', '{$page_url}'.$filterargs_html, $templates->cache[$t]);
			}
		}


My Blog
(This post was last modified: 03-22-2012 02:00 PM by ZiNgA BuRgA.)
03-22-2012 01:59 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
Heavy bug on Lyrics site - Glas - 03-22-2012, 10:09 AM
RE: Heavy bug on Lyrics site - ZiNgA BuRgA - 03-22-2012, 11:04 AM
RE: Heavy bug on Lyrics site - Glas - 03-22-2012, 11:39 AM
RE: Heavy bug on Lyrics site - ZiNgA BuRgA - 03-22-2012 01:59 PM
RE: Heavy bug on Lyrics site - Glas - 03-23-2012, 02:15 AM

 Standard Tools
Forum Jump: