Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Jul 2003
Posts: 4
Junior Member
Junior Member
Offline
Joined: Jul 2003
Posts: 4
For anyone that is interested I have been able to hack the content islands in such a way that they will, to an extent carry the featured properties of the topics with them.

In the ubb_topic_maint.cgi file, in the stick_topic, and unstick_topic sub functions add the following section of code... taken from the reply file. Add it just after the sticky is added or removed and just before the cache is cleared.

# Update the CI & TAT indexes
&RequireCode("$vars_config{CGIPath}/ubb_lib_ci.cgi");
my @td = &GetThreadData($in{f}, $in{t});
&update_tat($in{f}, $in{t}, @td);
&refresh_recentmeta($in{f}, $in{t}, "000000", "update", @td);
&update_cis($in{f});
&update_cis("ALL");

In the flat file/template directory modify the public_ci_posts.pl

add

# custom
# check if the topic is featured, if so change the background color
if ($topics->{$indie}->[1] =~ /S/){
$vars_style{$alts[0]} = "#FFE8E8";
}
elsif ($topics->{$indie}->[1] =~ /X/){
$vars_style{$alts[0]} = "#CCFFBB";
}
# custom

to the the ci_create_posts_html sub function, just before the $title varible is assigned. This specific code only changes the background of a given cell to red or green, red for featured green for closed. You could do alot like change the font , add a featured icon. But hopefully this will help anyone with that asperation in the future.

Sponsored Links
Joined: Mar 2001
Posts: 7,394
LK Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
Joined: Mar 2001
Posts: 7,394
welcome to ubbdev, nice code smile could be cool to add the sticky "!" image or a lock image to Content Island laugh

Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
::claps:: very nice, welcome smile


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Joined: Feb 2001
Posts: 2,285
Old Hand
Old Hand
Joined: Feb 2001
Posts: 2,285
As most of the folks here can attest, I'm a bit slow. Do you have an example of what this would look like? laugh

Joined: Nov 2001
Posts: 1,704
CTM Offline
Moderator / Da Masta
Moderator / Da Masta
Offline
Joined: Nov 2001
Posts: 1,704
Quote
quote:
Originally posted by Stilgar:
As most of the folks here can attest, I'm a bit slow. Do you have an example of what this would look like? laugh
Basically, when a Content Island is pulled in from UBB, the background colour of the table cell will change depending on the topic's status. If it is a featured (sticky) topic, the cell background colour will be #FFE8E8, and if the topic is closed, the cell background color will be #CCFFBB. smile

Welcome to UBBDev, hb1980, thanks for that tip smile It'd also be cool to highlight "burning" topics if they're enabled on the UBB this is being installed on... smile

Sponsored Links
Joined: Jul 2003
Posts: 4
Junior Member
Junior Member
Offline
Joined: Jul 2003
Posts: 4
I thought of a featured icon too, it would be a quit an easy modification to the above code. In the public_ci_posts, just below where you insert the above code look for where the html is constructed.

Code
    111                 $html .= qq!
112 <tr bgcolor="$vars_style{$alts[0]}"><td><font size="$vars_style{TextSize}"
113 face="$vars_style{FontFace}" color="$vars_style{TextColor}">
114 <a title="posted $timestamp" href="$vars_config{CGIURL}/ultimatebb.cgi?ubb=get_topic;f=$fora;t=$topi$pglnk$lpa">$customicon$title </a> - $pdn $reps
115 </font></td></tr>!;
Notice the $customicon varible....modify the if statement to something like this.

Code
add

# custom
# check if the topic is featured, if so change the background color
my $customicon
if ($topics->{$indie}->[1] =~ /S/){
$customicon = "<img src='./featured.gif'> ";
}
elsif ($topics->{$indie}->[1] =~ /X/){
$customicon = "<img src='./closed.gif'>;
}
else {
$customicon = "<img src='./spacer.gif'>
}
# custom
I haven't tested that code but the basic principles are the same, that would place a gif just before the title based on the post status. Burning topics are probably just as easy i simply don't know the flag to look for, for a burning topic.

Joined: Nov 2001
Posts: 1,704
CTM Offline
Moderator / Da Masta
Moderator / Da Masta
Offline
Joined: Nov 2001
Posts: 1,704
I guess the thing to do would be to check the number of replies, then check if it equals or beats $vars_display{HotCount} (checking first whether $vars_display{HotIcons} equals ON or OFF)... You could really turn this into a nice little modification smile

Joined: Jul 2003
Posts: 4
Junior Member
Junior Member
Offline
Joined: Jul 2003
Posts: 4
Yeh i guess you could, its just something that urked me for a long time that a topic status didn't communicate onto the island.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Ruben Rocha
Ruben Rocha
Lutz,FL,USA
Posts: 254
Joined: January 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240506)