MyBB Hacks

Full Version: Is this possible? Displaying threads on index with x criteria
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Yes, latest threads showing an image from each of the latest threads. I'll change the design a bit though, but that's for me to figure out, haha. Like in the image in the OP: http://i.imgur.com/wf6fJ.jpg
Similar to this (?):
http://mybbhacks.zingaburga.com/showthre...http://mybbhacks.zingaburga.com/showthread.php?tid=1347&pid=1137

If you don't mind some editing to the file, you can try it.

Open up the file:

Change the settings:

PHP Code:
$fids = array('2','3');// Forum IDs
$xtimgdim = array('w'=>75,'h'=>75);// XThreads image thumbnail dimension


Find this code:

PHP Code:
$xttimg_index_latest_threads = xttimg_threads_run($fids,5,'dateline','xttimg_index_latest_threads_thread','xttimg_index_latest_threads','timg',$xtimgdim,$avdim);


Replace the timg with your XThreads image key, example for the main image in the Brand Directory example application: mimg

Remove this line:

PHP Code:
$xttimg_index_most_viewed_threads = xttimg_threads_run($fids,5,'views','xttimg_index_most_viewed_threads_thread','xttimg_index_most_viewed_threads','timg',$xtimgdim,$avdim);

You can use the line above if you want to add another blocks.
If you don't want it, you can remove xttimg_index_most_viewed_threads and xttimg_index_most_viewed_threads_thread templates.

Put {$xttimg_index_latest_threads} variable manually in your index template.

If it is not what you want, maybe we can modify it.

Hi RateU! Sorry I had neglected to follow up with you on this before, but all of your suggestions worked fine. Smile Thank you!

I was wondering if it would be possible to embed these templates within the forumbit_depth2_forum template instead of just the index?
So you want to show this in thread lists (sub-forums)? You will need to hook at forumdisplay_start I think.
(02-05-2013 04:35 AM)Sama34 Wrote: [ -> ]So you want to show this in thread lists (sub-forums)? You will need to hook at forumdisplay_start I think.

No, on the index within the forumbit.
I think you can simply move {$mnxt_mrtxpd_threads} around your index template. Maybe I'm misunderstanding.
It has to be within the forumbit_depth2_forum template ... there is a reason for this.

http://i.imgur.com/guNv7kk.png

Haralooks and Brand Directory are links to forums, and they are actually the templates
xttimg_index_latest_threads and mnxt_mrtxpd_threads, respectively. However, because of this, it's impossible to pull the unread status and last post information properly.

I can customize the display of each forumbit using template conditionals, but in order to get the last post info and unread status I need to have those templates as a part of the forumbit.
Oh I see, you will probably need to wait for rate, I'm unsure how the plugin works at that extend.
(02-04-2013 07:56 AM)brad-t Wrote: [ -> ]I was wondering if it would be possible to embed these templates within the forumbit_depth2_forum template instead of just the index?
Maybe you need to change the hook.
Try this way:
Open the file, find:

PHP Code:
$plugins->add_hook('index_start','xttimg_index_index');
function xttimg_index_index(){

Replace it with:

PHP Code:
$plugins->add_hook('build_forumbits_forum','xttimg_index_index');
function xttimg_index_index(&$f){
	if(THIS_SCRIPT != 'index.php' || $f['fid'] != 21) return;

Change the 21 with your forum id.
Put your variable, for example: {$GOBALS['xttimg_index_latest_threads']} in your forumbit_depth2_forum template.
[attachment=921]

(02-05-2013 04:46 AM)brad-t Wrote: [ -> ]customize the display of each forumbit using template conditionals,
If it is a custom complex forumbit_depth2_forum template, personally, I prefer to use the XThreads's Template Prefix feature for creating the custom template.
Thanks as always dear RateU!

Let me know if you are ever looking for paid work – I'm sure I could use your help on a lot of things Smile
Pages: 1 2 3
Reference URL's