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

 
 
Release Tools Display Modes
Prev Previous Post   Next Post Next
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

 

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 04:59 PM
Latest links module ? henrikhansen Geek Gazette 4 07-12-2007 11:31 PM
Latest Threads Module? convergent Geek Article and Review System 5 05-28-2007 12:54 AM
Latest Reply Module Lizard King Geek Article and Review System 2 01-27-2006 01:30 AM
Latest articles module? tormodg Geek Article and Review System 2 11-26-2005 06:31 PM


All times are GMT. The time now is 11:57 AM.


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

Release powered by GARS 2.1.9 ©2005-2006