Results 1 to 4 of 4

Thread: 2nd Latest Topics Module

  1. #1
    Join Date
    Apr 2005
    Location
    California, USA
    Posts
    138

    Thumbs up 2nd Latest Topics Module

    This is how to make a 2nd Latest Topics Module for CMPS v2.x. I personally needed a module that showed the Latest Jokes by their creation date only. Also the way my module templates are, I can't use the MODULE SHELL template for modules on my right or left column. Below I show the basic instructions for the typical module creation for a 2nd Latest Topics Module. But for those of you in my situation, I also explain how I went about getting the additional template files to work without the Module Shell template.

    There might be a better way, but this is how I went about doing it.

    1. Go to the modules directory on your server and make a copy of your latesttopics.php module file and then rename it to whatever you want. For me, I made it to latestjokes.php.

    2. If you want this new module to list the threads by THREAD CREATION DATE like I needed to do, open your new file from Step 1. If you want it to work like it does by default, move onto Step 3. Do a search for ORDER BY lastpost DESC and change the word lastpost to thread.dateline so that it reads ORDER BY thread.dateline DESC

    3. Upload the file you created in Step 1 to your modules directory on your webserver with the other modules. (ie.ForumRoot/modules)

    4. On your webpage, go to the AdminCP. Now go to vBa CMPS>Edit Modules and then click on Latest Forum Topics. Top of page at MODULE TOOLS under the SELECT AN ACTION, on the drop down choose COPY and then hit the GO button. Page will reload. Its a copy of the Latest Forum Topics and it won't truely exist until you make some edits and hit the SAVE button. Change the MODULE TITLE to whatever you want. For me it was Latest Jokes. And do all the other edits you normally do with the modules such as what column it appears in, which forums to display and so on. When done hit the SAVE button.

    5. If you use the Module Shell template for all your modules irregardless of what column they go in, your done! That's it. Wasn't that easy? CMPS v2.0 makes it simple. If you are in my situation where you can't use the Module Shell template for your left or right columns, but only your center columns, continue on to Step 6. To understand why I can't use the Module Shell, feel free to look at my site and you'll notice how I use curved boxes that die into the sides of the pages. Its an adult humor site so you've been warned. No porn on the front page, just maybe some objectionable text depending on what others have titled their threads. http://www.MortysTwistedWorld.com

    6. Can't use the Module Shell template for your right or left columns? For those that are used to just pasting their unique right and left template code into templates for modules to make them look right, you'll notice that with the Latest Topics module or whatever you titled yours will be individual repeated blocks. If you chose to display 10 Latest Topics, it will actually appear that you have 10 modules that are only displaying 1 topic. Its the way the latesttopics.php page works and repeats itself and calls for templates.

    7. In your website's AdminCP, click on STYLES & TEMPLATES>STYLE MANAGER and then on the drop down, select ADD NEW TEMPLATE. For my side modules, I have a table that sorta wraps around the module content and the content is just displayed in a cell. So I have to create a TOP template and a BOTTOM template to avoid that repeating module "look" that happens by default. Create a title for this new template, I'll use my title, latesttopicbits_jokes_top. Then put all your content in the Template box and hit SAVE. Then repeat this step to add a new template, in which I created latesttopicbits_jokes_bottom. Again hit SAVE when done.

    7. Open your new file you created in Step 1. You need your TOP and your BOTTOM template to wrap all the content created by this module.

    Do a search for (should be about line 11):
    PHP Code:
    if ($mod_options['portal_threads_maxthreads'])

    Below ADD (edit to be the same as the template you created first in Step 7):
    PHP Code:
    {
    eval(
    '$home["$mods[modid]"][\'content\'] .= "' fetch_template('latesttopicbits_jokes_top') . '";');

    Do a search for (should be about line 120):
    PHP Code:
    $DB_site->free_result($threads);
      unset(
    $thread$foruminfo);

    Above ADD (edit to be the same as the template you created second in Step 7):
    PHP Code:
    {
    eval(
    '$home["$mods[modid]"][\'content\'] .= "' fetch_template('latesttopicbits_jokes_bottom') . '";');

    Save and upload back to your server.

    8. Now go try out your new module. Should be working just fine!

    Additional Note: Since my Latest Jokes only lists the thread titles, I had to create a copy of the adv_portal_latesttopicbits and I named it latesttopicbits_jokes and deleted a bunch of the stuff to clean up the template so it only displays the thread title. If you find you need to do the same thing, open back up your file you created in Step 1 and about line 103 you should see:
    PHP Code:
    eval('$home["$mods[modid]"][\'content\'] .= "' fetch_template('adv_portal_latesttopicbits') . '";'); 
    Just edit that template name to whatever your template was.

    I hope this helps a few people out. Sorry if I typed too much. I've never posted a hack or whatever you want to call this thing. This is my first time. Mind you I'm not very good at php or any type of coding.

    Enjoy!

  2. #2
    Join Date
    Jan 2005
    Posts
    66

    Default Re: 2nd Latest Topics Module

    Could someone update this to work with VB 3.5 and vBA 2.1.0 ?

  3. #3
    Join Date
    Apr 2005
    Location
    California, USA
    Posts
    138

    Default Re: 2nd Latest Topics Module

    Quote Originally Posted by stark
    Could someone update this to work with VB 3.5 and vBA 2.1.0 ?
    With vb3.5 and the latest vbadvanced, you don't have to go through all this trouble I did.

    Just go to your AdminCP>CMPS and go to EDIT and select the Latest Discussions/Topics that is already working on your site.

    When you open that module to edit it, at the very top there are 2 drop down menus. Believe its the first one, you select COPY on the drop down list then hit SAVE on the page. You know have 2 Latest Discussions.

    Just go in and change the title and whatever functions you want of the 2nd (copied) one that you just created.

    They made it simple now. Non of this garbage I had to do.

  4. #4
    Join Date
    Jan 2005
    Posts
    66

    Default Re: 2nd Latest Topics Module

    Quote Originally Posted by MortysTW
    With vb3.5 and the latest vbadvanced, you don't have to go through all this trouble I did.

    Just go to your AdminCP>CMPS and go to EDIT and select the Latest Discussions/Topics that is already working on your site.

    When you open that module to edit it, at the very top there are 2 drop down menus. Believe its the first one, you select COPY on the drop down list then hit SAVE on the page. You know have 2 Latest Discussions.

    Just go in and change the title and whatever functions you want of the 2nd (copied) one that you just created.

    They made it simple now. Non of this garbage I had to do.
    Ahhh... thank you

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Latest Topics module ignoring forum permissions?
    By EricR in forum Troubleshooting & Problems
    Replies: 3
    Last Post: 06-11-2005, 01:26 PM
  2. Change Displayed title of Latest Topics Module
    By nchoose in forum Troubleshooting / "How do I..." Questions
    Replies: 3
    Last Post: 03-28-2005, 01:59 PM
  3. Latest Forum Topics module
    By Allen Mead in forum Troubleshooting / "How do I..." Questions
    Replies: 2
    Last Post: 03-25-2005, 01:19 PM
  4. new module that acts like news archive or latest topics?
    By cyr0n_k0r in forum Troubleshooting / "How do I..." Questions
    Replies: 3
    Last Post: 09-11-2004, 04:55 PM
  5. Latest topics module breaks forum display
    By mferguson in forum Troubleshooting / "How do I..." Questions
    Replies: 2
    Last Post: 06-05-2004, 12:22 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •