Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Wont show up with "Recent Threads On Index"
ollie2015 Offline
Member
***
Posts: 90
Joined: Jan 2015
Post: #1
Wont show up with "Recent Threads On Index"
Wont show up with "Recent Threads On Index"
by dragonexpert  

but my globals are not showing up

Quote:
{$GLOBALS['threadfields']['key']}

help please
01-31-2015 08:10 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #2
RE: Wont show up with "Recent Threads On Index"
Custom plugins won't be pulling XThreads' field data, so it won't be there.

My Blog
01-31-2015 10:19 PM
Find all posts by this user Quote this message in a reply
ollie2015 Offline
Member
***
Posts: 90
Joined: Jan 2015
Post: #3
RE: Wont show up with "Recent Threads On Index"
Quote:$query = $db->query("
            SELECT t.*, u.username AS userusername, u.usergroup, u.displaygroup, u.avatar as threadavatar, u.avatardimensions as threaddimensions, lp.usergroup AS lastusergroup, lp.avatar as lastavatar, lp.avatardimensions as lastdimensions, lp.displaygroup as lastdisplaygroup
            FROM ".TABLE_PREFIX."threads t
            LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid)
            LEFT JOIN ".TABLE_PREFIX."users lp ON (t.lastposteruid=lp.uid)
            WHERE 1=1 $where AND t.visible > {$approved} {$unsearchableforumssql} {$ignoreforums}
            ORDER BY t.lastpost DESC
            LIMIT $threadlimit
        ");

how can the custom plugin call the data? from which table?

cheers
02-01-2015 12:17 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #4
RE: Wont show up with "Recent Threads On Index"
If you're looking at how to modify it yourself, you can use this function as a guideline:

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
// only 'username' and 'fid' keys are used from the $thread array
function xthreads_get_threadfields($tid, &$threadfields, $noextra=true, $thread=array()) {
	$tid = (int)$tid;
	if(!$tid) return;
	
	if(empty($thread))
		$thread = get_thread($tid);
	
	if($thread['fid'] == $GLOBALS['fid']) // use global cache if we're referring to current forum
		$threadfield_cache =& $GLOBALS['threadfield_cache'];
	if(!isset($threadfield_cache))
		$threadfield_cache = xthreads_gettfcache((int)$thread['fid']);
	
	if(!empty($threadfield_cache)) {
		global $db;
		$threadfields = $db->fetch_array($db->simple_select('threadfields_data', '`'.implode('`,`', array_keys($threadfield_cache)).'`', 'tid='.$tid));
		if(!isset($threadfields)) $threadfields = array();
		foreach($threadfield_cache as $k => &$v) {
			xthreads_get_xta_cache($v, $tid);
			xthreads_sanitize_disp($threadfields[$k], $v, $thread['username'], $noextra);
		}
	}
}


My Blog
02-01-2015 02:40 PM
Find all posts by this user Quote this message in a reply
ollie2015 Offline
Member
***
Posts: 90
Joined: Jan 2015
Post: #5
RE: Wont show up with "Recent Threads On Index"
omg lol

how do i use it to pull info anywhere i need to?
02-01-2015 07:49 PM
Find all posts by this user Quote this message in a reply
ollie2015 Offline
Member
***
Posts: 90
Joined: Jan 2015
Post: #6
RE: Wont show up with "Recent Threads On Index"
Any help here please.

How can i pull the data onto the index and elsewhere, thanks
02-02-2015 09:53 PM
Find all posts by this user Quote this message in a reply
ollie2015 Offline
Member
***
Posts: 90
Joined: Jan 2015
Post: #7
RE: Wont show up with "Recent Threads On Index"
So how do i use that to return a value or an array of values?

Code:
&$threadfields


what does that mean, sorry I am a noob

if I call

xthreads_get_threadfields($tid, &$threadfields[$KEY]), how can I get it to return a value?

VALUE ? or ARRAY()?

Code:
 return $v;

(This post was last modified: 02-13-2015 10:19 PM by ollie2015.)
02-13-2015 10:13 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #8
RE: Wont show up with "Recent Threads On Index"
http://php.net/manual/en/language.references.pass.php

My Blog
02-14-2015 10:13 PM
Find all posts by this user Quote this message in a reply
ollie2015 Offline
Member
***
Posts: 90
Joined: Jan 2015
Post: #9
RE: Wont show up with "Recent Threads On Index"
how do i LEFT JOIN the Xthreads tables on to the normal mybb threadtable?

thanks
02-27-2015 08:04 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: