MyBB Hacks

Full Version: Heavy bug on Lyrics site
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
(03-22-2012 10:09 AM)glas Wrote: [ -> ]What do? =(
Well, if it really is heavy, might need to do some weight lifting...

Looks like a conflict with Google SEO URLs.
I'll see if I can do something about it.
it really is beacuse i can only see the first 8 songs  from each cat, other ones are unaccesable beacuse of the bug (exept if they are saw in "all categories" mode)
You can try this edit to inc/xthreads/xt_forumdhooks.php

Replace

PHP Code:
		$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:
		// 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]);
			}
		}

Now seems to be working fine

Thanks!! Biggrin
Reference URL's