UBB.Dev
Posted By: Jason Edwards Display multiple categories - 05/18/2002 8:54 AM
Hi,

I sit possible in UBB to display certain categories at once? For example I have one common category and each service has its own category. Is there a way to show the common and a certain other category? Like cat 2&5 in one viwe and then in another forum 2&3?

I know you can do this with ubb threads but I would like to do it in ubb.

Thanks alot,

Jason
Posted By: joking-down Re: Display multiple categories - 05/18/2002 2:16 PM
I say, you can modify your board to show a common category with others categories...

but this mod is very time intensive to code!!!
one problem is in the "common category" the jump-list to the other forums of the current category.
Posted By: Charles Capps Re: Display multiple categories - 05/18/2002 6:27 PM
Uh, actually, this should be pretty easy to code - loop the code that performs category assembly if $in{category} != $num_of_target_cat...
Posted By: Jason Edwards Re: Display multiple categories - 05/19/2002 5:03 AM
Sir,

I am a child (and firm believer) of the multihack so can you help me out. I am so happy you found my solution, I was afraid it couldnt be done.

I found the line like you said
quote:
$in{category} != $num_of_target_cat

But I dont understand exactly what you want me to do. Soryy I am quite the newbie ;-)

Here is mine from ultimatebb.cgi, what should I change it to?

quote:
if ($ubb eq 'forum') {

if ($in{f} =~ /CAT:/) {

my ($j, $cat_number);
($j, $cat_number) = split (/:/, $in{f});
$in{category} = $cat_number;
&RequireCode("$vars_config{CGIPath}/ubb_forum_summary.cgi");
&forum_summary;
} else {
&RequireCode("$vars_config{CGIPath}/ubb_forum.cgi");
&get_forum;
}
exit(0);
} # end forum

Thanks again!!!!!!!

Jason
Posted By: Jason Edwards Re: Display multiple categories - 05/20/2002 7:26 PM
Hi,

I know Charles is probably busy but can anyone else help on this? I really dont wanna go hacking around with my level of knowledge.

Thanks again,

Jason
Posted By: Charles Capps Re: Display multiple categories - 05/20/2002 7:34 PM
Take a look around ubb_forum_summary and public_forum summary - they'll have the category handling code.
Posted By: Jason Edwards Re: Display multiple categories - 05/22/2002 1:52 AM
Charles,

I found the references but I dont know what to do with them. I am still new at this and I cant figure out exactly what to change.

Here are the references I think are what I need to change. Thanks for your patience with me.

ubb_forum_summary.cgi

quote:
$in{category} = "" unless exists $in{category};

if (!$in{category}) {

#&ServeFromCache("ubb_files/summary/summary.html");
my $filename = "$vars_config{NonCGIPath}/cache-$cache_cookie/ubb_files/summary/summary.html";

if ((-e $filename) && (-s $filename) && ($vars_misc{use_cache} ne "no")) {
my $file = &OpenFileAsString($filename);
$file = &ProcessVIEWS($file);
print &FilterPNTF($file);
exit(0);
} else {
&ServeFromCache("ubb_files/summary/summary.html");
} #endif

} else {

if ($vars_display{CategoriesOnly} ne 'false') {

# if this is a category-only view & specific category is selected
#&ServeFromCache("ubb_files/summary/summary-$in{category}.html");
my $filename = "$vars_config{NonCGIPath}/cache-$cache_cookie/ubb_files/summary/summary-$in{category}.html";

if ((-e $filename) && (-s $filename) && ($vars_misc{use_cache} ne "no")) {
my $file = &OpenFileAsString($filename);
$file = &ProcessVIEWS($file);
print &FilterPNTF($file);
exit(0);
} else {
&ServeFromCache("ubb_files/summary/summary-$in{category}.html");
} #endif
}
}

Public_forum_summary.pl

quote:
sub CategoryStrip {

my $CategoryStrip = qq~


$CategoryName


~;

return ($CategoryStrip);

} #end category strip

sub Cat_Row {

my $row = qq~



$cat_name



$forum_count

~;

return ($row);
} # end cat row

Thanks again sir,

Jason
Posted By: Jason Edwards Re: Display multiple categories - 05/30/2002 9:39 AM
Still cant figure this out, any ideas? I am jsut a novice when it comes to scripting and I dont know what to add or delete or change.

I would really like to do this though.

Thanks again,

Jason
Posted By: Jason Edwards Re: Display multiple categories - 06/22/2002 10:49 AM
Found the answer here - https://ubbdev.com/ubbcgi/ultimatebb.cgi?ubb=get_topic;f=28;t=000956#000002
© UBB.Developers