Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Showcase forum global threadfields in index
bppratama Offline
Junior Member
**
Posts: 7
Joined: May 2015
Post: #1
Showcase forum global threadfields in index
I want to ask about threadfields value.

i already use showcase forum xthreads and there is

Code:
1
2
3
4
5
6
7
8
9
10
11
2. Next, we will create a textbox for Website URL:
Create a Custom Thread Fields with this settings:

    Title: Website URL
    Key: scfurl
    Description: e.g: www.yoursite.com
    Applicable Forums: 'select the forum in point 1'
    Input Field Type: Textbox
    Editable by / Required Field?: Everyone (required)
    Display Order: 2
    Later, we need to put {$GLOBALS['threadfields']['scfurl']} variable to display it into our template.

Quote:http://mybbhacks.zingaburga.com/showthre...http://mybbhacks.zingaburga.com/showthread.php?tid=295&pid=15

it's show in forum display template like this

Code:
Link : <a href="http://{$GLOBALS['threadfields']['scfurl']}"><strong>{$GLOBALS['threadfields']['scfname']}</strong></a>


i want to ask about {$GLOBALS['threadfields']['scfurl']}, can i use this code to display it in index.php?
i want to display latest showcase forum and the details like Name and URL in index.php, how could i do that?

i already add that code {$GLOBALS['threadfields']['scfurl']} to index template and nothing happenErf

I do read this

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);
		}
	}
}


but how to call it in index.php?
thanks for ur help

(This post was last modified: 05-17-2015 01:18 PM by bppratama.)
05-17-2015 12:50 AM
Find all posts by this user Quote this message in a reply
bppratama Offline
Junior Member
**
Posts: 7
Joined: May 2015
Post: #2
RE: Showcase forum global threadfields in index
bump i need this please help
05-17-2015 12:24 PM
Find all posts by this user Quote this message in a reply
bppratama Offline
Junior Member
**
Posts: 7
Joined: May 2015
Post: #3
RE: Showcase forum global threadfields in index
Edit

i already add this in index
Quote:$scf_url = xthreads_get_threadfields($threadfields['scfurl']);

and call it in template

PHP Code:
URL : {$scf_url}


nothing to show?Ouch
please help

05-17-2015 01:17 PM
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: Showcase forum global threadfields in index
Your code doesn't even match the function call signature, so obviously won't work.

My Blog
05-18-2015 05:34 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: