The vB Geek

Go Back   The vB Geek > vB Geek Products > Geek Article and Review System

Geek Article and Review System GARS is the mega popular system for turning forums into articles, tutorials, or even reviews.

Advertisement
  Learn how to remove ads

Reply
 
Thread Tools Display Modes
  #1  
Old 10-10-2005, 02:49 PM
SALvation SALvation is offline
Junior Member
 
Join Date: Oct 2005
Posts: 6
Geek Article and Review System License Holder 
Default Modified top.php

I changed top.php just a bit to better suit our needs. I changed the order by to DESC and also added the total number of views after the article name. You can see how the change looks here:

http://www.gamemecca.net/forums/showthread.php?t=74695

Just wanted to post this as a suggestion for your next version. Great product by the way. Thanks!
Reply With Quote
  #2  
Old 10-11-2005, 08:32 AM
The Geek's Avatar
The Geek The Geek is offline
Senior Member
 
Join Date: Aug 2005
Posts: 6,717
Geek Article and Review System License Holder GeekMart License Holder Geek Auto-Linker Pro License Holder Geek Advertising Banner License Holder Geek Gazette License Holder 
Default

Thanks for that - looks good (as does the forum!). Care to attach the ammended top.php for others? (ill fold the asc changes into next iteration).
Reply With Quote
  #3  
Old 10-12-2005, 01:14 PM
Sniper Sniper is offline
Junior Member
 
Join Date: Oct 2005
Posts: 13
Geek Article and Review System License Holder 
Default

that looks amazing man! The Geek is it ok to use the script, I know its beta nbut I don't wana have to set it up again if you change things.
Reply With Quote
  #4  
Old 10-12-2005, 02:10 PM
SALvation SALvation is offline
Junior Member
 
Join Date: Oct 2005
Posts: 6
Geek Article and Review System License Holder 
Default

Here is the modified top.php script for anyone that wants it:

PHP Code:
<?php
    
##################################################################################
    ##                                                                                ##
    ##  Geek Article and Review System beta 3                                        ##
    ##  Stick this file in your forums/gars/mods folder                                ##
    ##    You could be scolded and publicly humiliated by altering or stealing my code##
    ##    Copyright 2005 by The Geek. Code may not be used in whole                     ##
    ##    or part without my written permission. You may not distribute this          ##
    ##    or any of my files without my written permission. If you do,                ##
    ##    you could face imprisonment on some desolate island far from civilization   ##
    ##    dweeb.                                                                      ##
    ##    This pretty box for example is mine. If you copy or modify this pretty box, ##
    ##  my suits will be on you like... well - like suits. Only poorly tailored     ##
    ##    cheap suits. People may make fun of you for such cheap suits.                ##
    ##                                                                              ##
    ##    top.php                                                                        ##
    ##    Last file chage 26.09.05                                                    ##
    ##                                                                              ##
     ## Copyright Â©2005 vBGeek. All Rights Reserved.                                 ##
     ## This file may not be redistributed in whole or significant part.             ##
    ## ---------------- GARS IS NOT FREE SOFTWARE ----------------                     ##
    ## http://www.thevbgeek.com                                                      ##
    ##################################################################################
    
$custom_top_based = array('1'=>'Read''2'=> 'Active''3'=> 'Latest');

    if (
$stage == "display")
    {
        
$title = ($value['settings']['based'] !="Top " "" ) . $custom_top_based[$value['settings']['based']] . " " $this->type['keywords_c'];
        
//get all forumids for type
        
if (is_array($this->settings['forums']))
        {
            foreach(
$this->settings['forums'] as $key1=>$value1)
            {
                if (
$value1 == $this->typeid)
                {
                    
$forumids .= ",$key1";
                }
            }
            if (
$forumids)
            {
                switch (
$value['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;
                }

                
$limit $value['settings']['limit'];
                
$results $this->db->query_read("SELECT t.title, t.views, t.replycount, t.threadid FROM " TABLE_PREFIX "thread t WHERE t.forumid in (-1$forumids) AND t.visible=1 $orderby LIMIT $limit");
                
//echo("SELECT t.title, t.views, t.replycount, t.threadid FROM " . TABLE_PREFIX . "thread t WHERE t.forumid in (-1$forumids) $orderby LIMIT $limit");
                
$bits "";
                while (
$result $this->db->fetch_array($results))
                {
                    
$bits .= "<tr><td class='alt2' align='left'><a href='showthread.php?t=$result[threadid]' title='Read more!'>$result[title]</a><br>($result[views] views)</td></tr>";

                }

                
$this->db->free_result($results);
                unset(
$result$results$info$ids);
                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 == "settings")
    {
        
print_description_row("This module will display the 'top' threads by type. This is really designed for a side column in the ForumDisplay section.");
        
print_input_row("Maximum number to show?""custom_top_limit[$i][$key]"$value['settings']['limit']);
        
print_select_row("Based on:""custom_top_based[$i][$key]"$custom_top_based$value['settings']['based']);
    }
    elseif(
$stage == "persistsettings")
    {
        
$modules[$i][$key]['settings']['limit'] = intval($_POST['custom_top_limit'][$i][$key]);
        
$modules[$i][$key]['settings']['based'] = intval($_POST['custom_top_based'][$i][$key]);
    }
?>
Reply With Quote
  #5  
Old 10-12-2005, 03:30 PM
The Geek's Avatar
The Geek The Geek is offline
Senior Member
 
Join Date: Aug 2005
Posts: 6,717
Geek Article and Review System License Holder GeekMart License Holder Geek Auto-Linker Pro License Holder Geek Advertising Banner License Holder Geek Gazette License Holder 
Default

Thanks for that!
Reply With Quote
Reply

Thread 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
Thread Thread Starter Forum Replies Last Post
Is this a modified version of GARS? pcoskat Geek Article and Review System 1 06-10-2008 12:28 PM
Modifying forumview.php and showthread.php for GARS only? Lars-Christian Geek Article and Review System 9 04-11-2007 06:20 PM
Featured/Latest/Top Active/Top Read Tutorials showing wrong thing Azhria Lilu Geek Article and Review System 5 05-22-2006 08:28 PM
How do I show top X by ratings (top.php) fyjpm Geek Article and Review System 1 03-22-2006 05:51 PM
Changing from index.php to forum.php? Michael Lizard Lounge 2 10-04-2005 03:27 PM


All times are GMT. The time now is 09:01 AM.


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