Site Default to Show a Single Default Category Instead of it Showing Sites in ALL Categories?

freecashpro

Professional Web Developer & Coder
I've using VisioList 1.5 and I'm using it in an unconventional way:

Yes, I'm using this Top Site List script to give me many more options than a static blog would give me. I installed VisioList 1.5 (fresh install) at my domain GPTAds.com with the intentions of using VisioList as a referral site management system (instead of a top site list)

I (myself only) will be adding sites to my list (will eventually remove links on becoming a site member and managing their own sites.) I'm only going to be adding the voting / tracking buttons on my own owned sites.
Once I have all or most of the sites I want listed then I guess I will be modifying the order of the sites on my list by directly changing values in the database ;) until I'm happy with it.

Anyways, my first plans are simply to get the settings dialed in and adding the majority of the sites I wish to be displayed on my referral site.

Anyways, here's my issue. I hate the way that VisioList (and Aardvark) default to showing ALL the sites from ALL the categories which usually looks to me like a total unrelated mess of sites that shouldn't be compared next to each other because some of my sites are 'GPT Sites' and some of my sites are 'Affiliate Networks', etc.

So, here is my question (finally!): :p

I don't want the site mixing the categories into a messy link soup as its default nature. I want to be able to have the site default to one (1) single category (for me that means that it's logical that I would want the rankings of all the 'GPT Sites' (only) displayed in a list showing other GPT sites.

If/when a site visitor wants to view other items compared ONLY against other sites in it's same category (for example I'd have 'Affiliate Networks' shown all alone in a list with other networks only.

Is there a way to set a single default category show to all new visitors to the site and have that not change unless / until my site visitor manually changes the category.

Yes, I've already thought of a way to do this but it's kind-of messy looking. I want the list site's URL up in the link bar to be showing that first category as it's home page (either with an index.php or even better NOTHING after my URL 'GPTAds.com' Maybe a better way of explaining it might be to just say that when a new visitor enters my site then I want is showing a list of all the GPT sites (only) showing NOT having the URL looking like this "http://www.gptads.com/category/Get-Paid-To-GPT-Sites/" but rather looking like this: http://www.gptads.com/

Yes, after the visitor makes another selection then yes, it's ok (or expected) that we'd start seeing the more complex URLs - that's no problem.

So, how do I default one category for it to show itself ONLY until another choice is made. Suggestions or any help at all would be appreciated - Thanks!

Oh, and I'm a highly technical person and not squeamish at all going in there and changing values within code and.or the code itself :cool: Thx.

screnshot#2781 - 'GPT Ads (Comprehensive Get Paid To Site List_'.png
 
Last edited:

freecashpro

Professional Web Developer & Coder
not by default no, you would need to make a custom plugin for that.
Ok, I've already started looking into modding the script for this purpose and it doesn't really seem that hard. In the mean time I've confirmed that a simple one-line addition to my site's .htaccess file to redirect to that URL would work as well.

Thank You for Your Prompt Reply,
 

joseveiga

New Member
Hi,

1) How can I set my topsites to always open in a specific category? .htaccess redirect?

2) Or better yet, is it possible for the site to open automatically in one category for visitors from Portugal and another category for visitors from Brazil?
 

Basti

Administrator
Staff member
Option #1 would not be possible, unless you incooperate php code which detects visitors country by ip. Well its possible, but that is out of the scope of this project or free help

Option #2 could be possible.
Either a htaccess redirect like you said, but i would avoid that, unneeded server burden if you ask me. But if you want to, feel free.

I'd use this simple plugin, We simply extend the frontpage query to load only members of a specific category.
This is based on VL 1.6, older versions might not work with this

1) inside /plugins/ create a new folder called "FrontAsCategory"
2) open that folder
3) create blank index.html file
4) create info.php with this content
Code:
<?php

// You must give a name for your Plugin.  The other fields are optional.
$pluginname = 'Frontpage - display category members';
$author = 'Basti';
$email = '';
$url = '#';
$install = 0;

$version = '1.0';
4) create rankings_extend_where.php with this content and change your default category name
Code:
// Modify this variable to state your default category
$frontpage_category = 'My default category name as found in admin';

if (empty($category_sql))
{
    // Handles category name in title or other plugins making use of this variable
    $TMPL['category'] = $frontpage_category;
    $TMPL['header']   = "{$LNG['main_header']} - {$TMPL['category']}";

    $frontpage_category_sql = $DB->escape($frontpage_category, 1);   
    $category_sql           = "AND category = '{$frontpage_category_sql}'";
}
elseif ($TMPL['cat_exist'] && $TMPL['cat_exist'] === $frontpage_category)
{
    // This makes sure we redirect any previously indexed default category to front page, so we not get double content
    header("HTTP/1.1 301 Moved Permanently");
    header("Location: {$CONF['list_url']}/");
    exit;
}
In here you might notice we have a redirect. Say you make your default category "my category"
But you still have your original category page with /category/my-category/ ( or ?cat=my-category )
These we need to redirect to the front page, else you would get duplicated content, hurting SEO
 
Last edited:
Top