vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=108725

Create "Latest Threads" Custom Page
by Princeton
23 Feb 2006 19:57

2 Attachment(s)
A simple [HOWTO] to display latest threads on a custom page.

If you don't have GTCUSTOM PAGES installed .. go download and upload product via Plugin Manager. You need GTCUSTOM PAGES to follow this article.

LETS GET STARTED

INSTRUCTIONS:
  1. create 2 templates
  2. add 1 phrase
  3. add function to functions_gtcustom.php
  4. edit goto.php
  5. visit page at $vboptions[bburl]/goto.php?section=newthreads

1)__ CREATE 2 TEMPLATES
Create "custom_thread" template:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Create "custom_threadrow" template:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

2)__ CREATE 1 PHRASE
Phrase Type: GTCustom Pages
Product: GTCustom Pages
Varname: gtcustom_newthreads_header
Text: Latest Threads

3)__ ADD FUNCTION TO functions_gtcustom.php
Copy the following function to functions_gtcustom.php (functions_gtcustom.php is included in GTCUSTOM PAGES product)
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

4)__ EDIT goto.php
FIND IN goto.php:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

REPLACE WITH:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

FIND:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

REPLACE WITH:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

5)__ DONE!
Now, go visit the page that you just created:
$vboptions[bburl]/goto.php?section=newthreads

Need any help? Contact me personally via private message.

NOTE:
  1. All html code is valid XHTML.
  2. This query will display all thread titles regardless of permission settings.

hiiped 23 Feb 2006 23:51

nice work

thanks

Princeton 24 Feb 2006 01:26

thanks for the feedback :up:

Clayton 27 Feb 2006 19:07

hi princeton

some great work going on here

i would like to the latest threads from one website[domain] and display it on another domain, would it be possible to do it with this hack, please?

thank you

C

Princeton 27 Feb 2006 22:31

try xml/rss/javascript syndication:
http://www.vbulletin.com/docs/html/v...group_external

justindwhite 02 Mar 2006 23:18

Whats the best way to put the:
"$vboptions[bburl]/goto.php?section=newthreads" on your non vb page?

I've tried using iframe as you can see on http://www.h2survivor.com, but when you click on a link it loads in the iframe. Anyone know a better way to do this or fix the iframe problem?

Also, I notice on the preview image that all the posts say 7:00PM. On my site, it also has every post as being posted at 7:00PM. I can't seem to figure this out on my own.

Princeton 03 Mar 2006 02:27

I made some changes..

IN gtcustom_threadrow replace
$thread[lastpost]
with
$thread[lastpostdate]

in the print_gtcustom_newthreads() replace
$thread['lastpost'] = vbdate($vbulletin->options['dateformat'], $thread['lastpost'], 1);
with
$thread['lastpostdate'] = vbdate($vbulletin->options['dateformat'], $thread['lastpost'], 1);

regarding the iframe ...
add a target attribute to your link ie.
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Clayton 03 Mar 2006 07:13

thanks princeton

will wait a little longer to see the different changes and then attempt to create the page with the forum threads on

Thank you

C

theguywhoknowz 14 Mar 2006 22:24

Ok so i was sucessful add the latest thread into a custom php page, but i resize the table, and the thread title is too long, it wrap down, is there a way that it only show the first 10 characters and the rest is "..." without wraping the text to the next line?

Princeton 15 Mar 2006 12:57

try fetch_word_wrapped_string($title, $limit)

theguywhoknowz 17 Mar 2006 23:11

K thanks but what if I want to show only 3,4 thread on the lastest thread, not 15 of them, how do i reduce the number of thread shown?

Princeton 18 Mar 2006 15:19

edit this line

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

to

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


theguywhoknowz 20 Mar 2006 17:17

thank you, princton, it works liek a champ, now the problem is, what if i want to change the font and style on that custom thread page, cause it use the forum css and it is bigger than my custom page font and size, is there a way?

theguywhoknowz 21 Mar 2006 21:13

Nvm, i got this.

ChrisBaktis 26 Mar 2006 15:38

Im looking to use something like this but instead of threads I would like to list members in order of the highest number in a custom profile field....I run a trading site and each time a member makes a trade we add 1 point to a custom profile field...I want to start from highest to lowest and list the member and how many trades they have. Would this work and if so what would I need to change?


All times are GMT. The time now is 09:07.

Powered by vBulletin® Version 3.8.12
Copyright © 2019, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.