#56073
07/22/2003 5:25 PM
|
Joined: Jul 2003
Posts: 4
Junior Member
|
Junior Member
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.
|
|
|
#56074
07/22/2003 5:34 PM
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
welcome to ubbdev, nice code could be cool to add the sticky "!" image or a lock image to Content Island
|
|
|
#56075
07/22/2003 6:02 PM
|
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
|
|
|
#56076
07/23/2003 12:30 AM
|
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?
|
|
|
#56077
07/23/2003 7:09 AM
|
Joined: Nov 2001
Posts: 1,704
Moderator / Da Masta
|
Moderator / Da Masta
Joined: Nov 2001
Posts: 1,704 |
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? 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. Welcome to UBBDev, hb1980, thanks for that tip It'd also be cool to highlight "burning" topics if they're enabled on the UBB this is being installed on...
|
|
|
#56078
07/24/2003 3:43 PM
|
Joined: Jul 2003
Posts: 4
Junior Member
|
Junior Member
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. 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. 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.
|
|
|
#56079
07/24/2003 4:03 PM
|
Joined: Nov 2001
Posts: 1,704
Moderator / Da Masta
|
Moderator / Da Masta
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
|
|
|
#56080
07/24/2003 7:20 PM
|
Joined: Jul 2003
Posts: 4
Junior Member
|
Junior Member
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.
|
|
|
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.
|
|
Posts: 254
Joined: January 2000
|
|
Forums63
Topics37,573
Posts293,925
Members13,849
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|