The vB Geek

Go Back   The vB Geek > vB Geek Modifications > Add-ons

Add-ons Modifications and add-ons for vB Geek stuff.

Advertisement
This is an HTML example. Isn't it just wonderful?!?!
  Learn how to remove ads

Comment
 
Release Tools Display Modes
Lizard King
Senior Member
Lizard King's Avatar

vB Version: x
 

Mod Version: x
 

Released: 01-28-2006
 

Installs: 9
 

Last Update: n/a
 

Rating:
 
Supported
DB Changes
Installer Included
Uses Plugins
Template Changes
Code Changes
Additional Files
Is a Beta!
Default Latest Reply Module (Beta)

I was missing latest replies module as i usually want my gars defined forums alphabatically listed.
I requested from Geek but he is on holiday right now so i tried to create one . I managed to add the module and even i managed to get the threads and then i messed up something :P but i managed to get it working then again it caused me a problem.

Then after trying several solutions i found the easist way is to modify top.php

Here is the modified top.php but i couldn't find a solution how to change module name
PHP Code:
<?php
 
    $custom_top_based 
= array('1'=>$vbphrase['GARS_top_read'], '2'=> $vbphrase['GARS_top_active'], '3'=> $vbphrase['GARS_top_latest'], '4'=>'Latest Replies');
 
    if (
$stage == "display")
    {
        
$title construct_phrase(($settings['based'] !=$vbphrase['GARS_top_x'] : $vbphrase['GARS_top_none_x']), $vbphrase['GARS_top_' . ($settings['based'] ==  'read' : ($settings['based'] == 'active' 'latest'))], $this->terms['capital_plural']);
        
$items $this->fetch_module_cache($itemid);
        if (!
is_array($items))
        {
            if (
is_array($this->settings['forums']) || is_array($settings['forums']))
            {
                if (
is_array($settings['forums']) && $settings['pull'])
                {
                    foreach(
$settings['forums'] as $value)
                    {
                        
$forumids .= ",$value";
                    }
                }
                else
                {
                    foreach(
$this->settings['forums'] as $key1=>$value1)
                    {
                        if (
$value1 == $this->typeid)
                        {
                            
$forumids .= ",$key1";
                        }
                    }
                 }
                if (
$forumids)
                {
                    switch (
$settings['based'])
                    {
                        case 
'1':
                            
$orderby "ORDER BY t.views DESC";
                            break;
                        case 
'2':
                            
$orderby "ORDER BY t.replycount DESC";
                            break;
                        case 
'3':
                            
$orderby "ORDER BY t.dateline DESC";
                            break;
                case 
'4':
                            
$orderby "ORDER BY t.lastpost DESC";
                            break;
                    }
 
                    
$limit intval($settings['limit']);
                    
$results $this->db->query_read("SELECT t.title, t.views, t.replycount, t.threadid, t.lastpost FROM " TABLE_PREFIX "thread t WHERE t.forumid in (-1$forumids) AND t.visible=1 $orderby LIMIT " . (intval($limit) ? $limit "5"));
                    
$items = array();
                    while (
$result $this->db->fetch_array($results))
                    {
                        
$items[] = $result;
                    }
                    
$this->cache_module($itemid$items);
                    unset(
$result$results$info$ids);
                    
$this->db->free_result($results);
                }
            }
        }
        if (
is_array($items))
        {
            
$bits "";
 
            foreach (
$items as $value)
            {
                
$bits .= "<tr><td class='alt2' align='left'><a href='showthread.php?t=$value[threadid]&amp;goto=newpost' title='$value[title]'>$value[title]</a></td></tr>";
            }
            if (
$bits)
            {
                
$bits "<tr><td class='alt1' align='left'><table border='0' cellspacing='2' cellpadding='5' width='100%'>$bits</table></td></tr>";
                eval(
'$output .="' fetch_template('GARS_mod_container') . '";');
            }
        }
    }
    elseif(
$stage == "persist")
    {
        
$this->cache_item_refresh($itemid);
    }
    elseif(
$stage == "settings")
    {
        
$pulltype = array(
            
'0'    => $vbphrase['GARS_pull_forums_same_type'],
            
'1'    =>    $vbphrase['GARS_pull_forums_selected']);
 
        
print_description_row($vbphrase['GARS_top_desc']);
        
print_input_row($vbphrase['GARS_top_max'], "custom_top_limit[$itemid]"$settings['limit']);
        
print_select_row($vbphrase['GARS_top_based'], "custom_top_based[$itemid]"$custom_top_based$settings['based']);
        
print_select_row($vbphrase['GARS_pull_forums_from'], "custom_top_pulltype[$itemid]"$pulltype$settings['pull']);
        
print_forum_chooser ("""custom_forums[$itemid][]"$settings['forums'], nullfalsetrue);
    }
    elseif(
$stage == "persistsettings")
    {
        global 
$vbulletin;
        
$vbulletin->input->clean_array_gpc('p',array(
            
'custom_top_limit'        =>     TYPE_ARRAY_ARRAY_INT,
            
'custom_top_based'        =>    TYPE_ARRAY_ARRAY_INT,
            
'custom_top_pulltype'    =>    TYPE_ARRAY_ARRAY_INT,
            
'custom_forums'            =>     TYPE_ARRAY_ARRAY_INT
        
));
        
$settings['limit']     = $vbulletin->GPC['custom_top_limit'][$itemid];
        
$settings['based']     = $vbulletin->GPC['custom_top_based'][$itemid];
        
$settings['pull']     = $vbulletin->GPC['custom_top_pulltype'][$itemid];
        
$settings['forums'] = $vbulletin->GPC['custom_forums'][$itemid];
        
$this->cache_item_refresh($itemid,9);
    }
?>
Release

Release Tools

  #1  
By Lizard King on 01-28-2006, 06:44 PM
Default

Geek can you also explain me what i did wrong ?

the first lastpost.php worked at the beginning but when i add the module in another gars defined forum it couldn't get the settings. then i tried with the other one but it messed up the settings all the way
Attached Files
File Type: zip latestposts.zip (1.5 KB, 28 views)
Reply With Quote
  #2  
By The Geek on 01-29-2006, 07:46 PM
Default

Ill check into it tomorrow. Thanks
Reply With Quote
  #3  
By Lizard King on 02-05-2006, 12:45 PM
Default

Quote:
Originally Posted by The Geek
Ill check into it tomorrow. Thanks
Any news
Reply With Quote
  #4  
By The Geek on 02-05-2006, 06:16 PM
Default

Thanks for the reminder Lizard... however I cant really see anything wrong with this. What problem are you having?
Reply With Quote
  #5  
By Lizard King on 02-05-2006, 07:31 PM
Default

The first one works perfect but the module name is the problem. I couldn't find a way to change the module name when i choose latest replies
Reply With Quote
  #6  
By The Geek on 02-06-2006, 05:51 AM
Default

module name? Im assuming you mean other than just saving it as another filename?
Reply With Quote
  #7  
By Lizard King on 02-08-2006, 02:53 PM
Default

Quote:
Originally Posted by The Geek
module name? Im assuming you mean other than just saving it as another filename?
The one i am using is the modified top.php which is in the first post.
Reply With Quote
  #8  
By The Geek on 02-08-2006, 06:16 PM
Default

Sure, but im not following you (either too much or too little caffine!)

What exactly is the problem? Cant you just save it as 'mynewmodule.php' and register it accordingly? Thats why I think im not following you
Reply With Quote
Comment

Release Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Release Release Starter Category Comments Last Post
Module: Show Latest Articles by Author jl255 Geek Article and Review System 1 06-22-2009 03:59 PM
Latest links module ? henrikhansen Geek Gazette 4 07-12-2007 10:31 PM
Latest Threads Module? convergent Geek Article and Review System 5 05-27-2007 11:54 PM
Latest Reply Module Lizard King Geek Article and Review System 2 01-27-2006 12:30 AM
Latest articles module? tormodg Geek Article and Review System 2 11-26-2005 05:31 PM


All times are GMT. The time now is 08:10 AM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.

Release powered by GARS 2.1.9 ©2005-2006