Greenguy's Board

Greenguy's Board (http://www.greenguysboard.com/board/index.php)
-   Programming & Scripting (http://www.greenguysboard.com/board/forumdisplay.php?f=15)
-   -   Help With gossamer Links 2.0 (http://www.greenguysboard.com/board/showthread.php?t=48862)

Twiceshy 2008-09-04 05:02 PM

Help With gossamer Links 2.0
 
I have gossamer links 2.0 on one of my sites and im trying to edit the colums for the catagories right now there are only two i want to break it into 4 colums but cant seem to find were to do this any help would be awesome example of what it is now is here

DangerDave 2008-09-04 05:06 PM

You will find the category listing structure at the bottom of - site_html_templates.pl

DD

Twiceshy 2008-09-04 05:09 PM

thank you DD much apreciated :)

Twiceshy 2008-09-04 06:10 PM

ok well im still lost i found were to edit but i just cant seem to get HOW to do it here is the code if anyone knows what i need to change or add would be great


Code:

# We now use a table to split the category name up into two columns.
# For each category you can use the following variables:
#
#  $url        : The URL to go to that category
#  $category_name : The category name with _ and / removed.
#  $category_descriptions{$subcat}: The category description (if any).
#  $numlinks  : The number of links inside that category (and subcategories).
#  $mod        : The newest link inside of that category.
#

    my (@subcat) = @_;
    my ($url, $numlinks, $mod, $subcat, $category_name, $description, $output, $i);
    my ($half) = int (($#subcat+2) / 2  );

    # Print Header.
    $output = qq|
\n|;
   
    foreach $subcat (sort @subcat) {
        ($description) = @{$category{$subcat}}[2];
       
# First let's get the name, number of links, and last modified date... 
        $url = "$build_root_url/" . &urlencode($subcat) . "/";
        if ($subcat =~ m,.*/([^/]+)$,) { $category_name = &build_clean($1); } else { $category_name = &build_clean($subcat); }
        $numlinks = $stats{"$subcat"}[0];
        $mod = $stats{"$subcat"}[1];

# We check to see if we are half way through, if so we stop this table cell
# and begin a new one (this lets us have category names in two columns).       
        if ($i == $half) {
            $output .= qq|
\n|;
        }
        $i++;

Twiceshy 2008-09-04 07:23 PM

Blahh i gave up just had to ajust my design and go with one table MML is Right this script is a pain in the ass but i paid for it now i have to use it .

Twiceshy 2008-09-04 07:30 PM

ok here is the code again
Code:

########################################################################################
# THE FOLLOWING DETERMINES YOUR CATEGORY LISTING, IT'S NOT TEMPLATE BASED (YET)!      #
########################################################################################

sub site_html_print_cat {
# --------------------------------------------------------
# This routine determines how the list of categories will look.
# We now use a table to split the category name up into two columns.
# For each category you can use the following variables:
#
#  $url        : The URL to go to that category
#  $category_name : The category name with _ and / removed.
#  $category_descriptions{$subcat}: The category description (if any).
#  $numlinks  : The number of links inside that category (and subcategories).
#  $mod        : The newest link inside of that category.
#

    my (@subcat) = @_;
    my ($url, $numlinks, $mod, $subcat, $category_name, $description, $output, $i);
    my ($half) = int (($#subcat+2) / 2  );

    # Print Header.
    $output = qq|
\n|;
   
    foreach $subcat (sort @subcat) {
        ($description) = @{$category{$subcat}}[2];
       
# First let's get the name, number of links, and last modified date... 
        $url = "$build_root_url/" . &urlencode($subcat) . "/";
        if ($subcat =~ m,.*/([^/]+)$,) { $category_name = &build_clean($1); } else { $category_name = &build_clean($subcat); }
        $numlinks = $stats{"$subcat"}[0];
        $mod = $stats{"$subcat"}[2];

# We check to see if we are half way through, if so we stop this table cell
# and begin a new one (this lets us have category names in two columns).       
        if ($i == $half) {
            $output .= qq|
\n|;
       
        }
        $i++;
       
# Then we print out the name linked, new if it's new, and popular if its popular.
        $output .= qq|
$category_name ($numlinks) |;
        $output .= qq|new| if (&days_old($mod) < $db_new_cutoff);
        $output .= qq|
|;
        $output .= qq|
$description
| if (!($description =~ /^[\s\n]*$/));
        $output .= qq|
|;       
    }

# Don't forget to end the unordered list..
    $output .= "
\n";
    return $output;
}

sub html_escape {
    my $escape = shift;
    $escape =~ s/&/&/g;
    $escape =~ s/     $escape =~ s/>/>/g;
    $escape =~ s/"/"/g;
    return $escape;
}

1;


HC-Majick 2008-09-04 07:46 PM

I sent you a pm

Twiceshy 2008-09-04 09:25 PM

Quote:

Originally Posted by HC-Majick (Post 418630)
I sent you a pm

I Just have to say Thank You so Much i was getting more grey hair and pretty much had given up you made my day

HC-Majick 2008-09-05 12:24 PM

This should give you the 4 columns...
Code:

########################################################################################
# THE FOLLOWING DETERMINES YOUR CATEGORY LISTING, IT'S NOT TEMPLATE BASED (YET)!      #
########################################################################################

sub site_html_print_cat {
# --------------------------------------------------------
# This routine determines how the list of categories will look.
# We now use a table to split the category name up into two columns.
# For each category you can use the following variables:
#
#  $url        : The URL to go to that category
#  $category_name : The category name with _ and / removed.
#  $category_descriptions{$subcat}: The category description (if any).
#  $numlinks  : The number of links inside that category (and subcategories).
#  $mod        : The newest link inside of that category.
#

    my (@subcat) = @_;
    my ($url, $numlinks, $mod, $subcat, $category_name, $description, $output, $i);
  $columns = '4'; #number of columns
my ($half) = int (($#subcat+2) / $columns);

    # Print Header.
    $output = qq|
\n|;
   
    foreach $subcat (sort @subcat) {
        ($description) = @{$category{$subcat}}[2];
       
# First let's get the name, number of links, and last modified date... 
        $url = "$build_root_url/" . &urlencode($subcat) . "/";
        if ($subcat =~ m,.*/([^/]+)$,) { $category_name = &build_clean($1); } else { $category_name = &build_clean($subcat); }
        $numlinks = $stats{"$subcat"}[0];
        $mod = $stats{"$subcat"}[2];

# We check to see if we are half way through, if so we stop this table cell
# and begin a new one (this lets us have category names in two columns).       
  if ($i == $half) {
$output .= qq|
\n|;
$i = 0; }
     
        }
        $i++;
       
# Then we print out the name linked, new if it's new, and popular if its popular.
        $output .= qq|
$category_name ($numlinks) |;
        $output .= qq|new| if (&days_old($mod) < $db_new_cutoff);
        $output .= qq|
|;
        $output .= qq|
$description
| if (!($description =~ /^[\s\n]*$/));
        $output .= qq|
|;       
    }

# Don't forget to end the unordered list..
    $output .= "
\n";
    return $output;
}

sub html_escape {
    my $escape = shift;
    $escape =~ s/&/&/g;
    $escape =~ s/     $escape =~ s/>/>/g;
    $escape =~ s/"/"/g;
    return $escape;
}

1;



All times are GMT -4. The time now is 05:19 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc