Previous Thread
Next Thread
Print Thread
Rating: 4
#219088 06/16/2002 6:57 PM
Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
It would be a great idea if before the title of any sticky posts it said Sticky or Announcement etc. At the moment it is not easy to see if a post is sticky or not.

Ian.



Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Sponsored Links
Gorlum #219089 06/16/2002 7:02 PM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Perhaps having a special icon that was only displayed with sticky posts. It would be used no matter what the chosen icon was by the poster.

Perhaps a graphic of a bright red pin that's used on bulletin boards?

This is probably an easy hack. Anyone else interested in this?

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
Something would be good at least, my users got very confused the first time I used it and new users will probably be in the future as well.

Gorlum #219091 06/16/2002 9:54 PM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
In your postlist.php script find this:

code:

// Setup the postrow array
$postrow[$z]['color'] = $color;
$postrow[$z]['indentsize'] = "0";
$postrow[$z]['folder'] = $folder;



and change it to this:

code:

if ($Sticky) {
$Subject = "<span class="new"><em>(sticky)</em></span> $Subject";
}
// Setup the postrow array
$postrow[$z]['color'] = $color;
$postrow[$z]['indentsize'] = "0";
$postrow[$z]['folder'] = $folder;





That should do it.

Joined: Jan 2001
Posts: 374
Enthusiast
Enthusiast
Offline
Joined: Jan 2001
Posts: 374
Good idea, it just does not work, $Sticky seems to have no value at that time. I placed the hack further down, below:

code:

// ----------------------------------------------------------
// If this post is sticky then we need to use the sticky date
if ($Sticky) {
$time = $html -> convert_time($Sticky,$user['U_TimeOffset']);
} else {
if ($view != "expanded") {
$time = $html -> convert_time($Last_Post,$user['U_TimeOffset']);
}
else {
$time = $html -> convert_time($Posted,$user['U_TimeOffset']);
}
}




and now it works here.

Sponsored Links
rodrigo1 #219093 06/17/2002 8:03 AM
Joined: Jan 2001
Posts: 374
Enthusiast
Enthusiast
Offline
Joined: Jan 2001
Posts: 374
And, what about this:

$Subject = "[<img src="{$config['images']}/ascend.gif" {$images['descend']} border="0" alt="" align="absmiddle" /> <span class="new">Info:</span> $Subject]";

rodrigo1 #219094 06/17/2002 8:38 AM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
That's odd, the code I showed was down below

code:

// ----------------------------------------------------------
// If this post is sticky then we need to use the sticky date
if ($Sticky) {
$time = $html -> convert_time($Sticky,$user['U_TimeOffset']);
} else {
if ($view != "expanded") {
$time = $html -> convert_time($Last_Post,$user['U_TimeOffset']);
}
else {
$time = $html -> convert_time($Posted,$user['U_TimeOffset']);
}
}



quite aways. I figured it had a value be then?

Joined: Mar 2002
Posts: 305
Enthusiast
Enthusiast
Offline
Joined: Mar 2002
Posts: 305
The code:
code:
// Setup the postrow array
$postrow[$z]['color'] = $color;
$postrow[$z]['indentsize'] = $indentsize;
$postrow[$z]['folder'] = $folder;



appears around line 133. It's very similar to the code you said to find -- the only difference is [:"red"]$indentsize;[/] instead of [:"red"]"0"[/]. I may have easily made the same mistake if I hadn't read this whole thread first!

Thank you!


[:"red"]Lisa[/]
JacquiL #219096 06/17/2002 7:04 PM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Thanks for clarifying

I always have second thoughts about mentioning line numbers because mine are usualy messed up from playing... lol

You could use this little hack to even specify a special icon such as the red pin for sticky posts. There's been a few times people thought something was broke but then discovered it was a sticky post doing exactly what it was ment to do... lol (myself included)

Joined: Oct 2001
Posts: 157
Member
Member
Offline
Joined: Oct 2001
Posts: 157
The initial code dave gave (hey, that rhymes!!) works fine. You just have to be carefull to place it in the 2nd instance where it appears (around line 864 of a clean script if I remember correctly). Also, you can change (sticky) up there to Sticky: or whatever you want to appear.

Thanks dave.


Yors Truly

Who? Me? Worry?
Sponsored Links
phill #219098 07/04/2002 2:17 AM
Joined: Oct 2001
Posts: 157
Member
Member
Offline
Joined: Oct 2001
Posts: 157
ummm....it was working in 6.0 br2, but now in 6.0.1 it isnt working Any ideas?


Yors Truly

Who? Me? Worry?
phill #219099 07/04/2002 2:34 AM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Try placing the hack in down around line 873. You should see these lines:

code:

// Setup the postrow array
$postrow[$z]['color'] = $color;
$postrow[$z]['indentsize'] = "0";
$postrow[$z]['folder'] = $folder;




Hope that helps. Not sure if that's the right spot. Just guessing.

Joined: Mar 2002
Posts: 305
Enthusiast
Enthusiast
Offline
Joined: Mar 2002
Posts: 305
This could probably be written up and moved to Beta or even Finished hacks -- works fine on our board.

I changed it from having the word "(sticky)" to having a small graphic []http://www.fishingfordeals.com/forums/images/pushpin.gif[/]. I uploaded a screen shot if someone wants to see what it looks like using the graphic.

To use a graphic instead of the word "(sticky)", I simply changed this:
code:
if ($Sticky) {
$Subject = "<span class="new"><em>(sticky)</em></span> $Subject";
}



to this:
code:

if ($Sticky) {
$Subject = "<img src="{$config['images']}/pushpin.gif" border="0" /> $Subject";
}

Attachments
52695-stickypic.jpg (0 Bytes, 32 downloads)


[:"red"]Lisa[/]
JacquiL #219101 07/17/2002 3:41 PM
Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
I like it!

JacquiL #219102 07/17/2002 10:25 PM
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
thanks, works well here

For xhtml compliance and just something that explains it to the newbie a bit better, you might want it to be something like this:

code:

if ($Sticky) {
$Subject = "<img src="{$config['images']}/pushpin.gif" border="0" alt="sticky" /> $Subject";
}



I looked for a language file entry for "sticky" but it just ain't there


- Allen wavey
- What Drives You?
JacquiL #219103 07/17/2002 10:36 PM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Very cool. Going to try this out this weekend.

Now.... if someone could do something similar if there is a file attached include this "disk" or paper clip icon, we'd be in heaven.

Daine #219104 07/17/2002 10:56 PM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
I think if you changed line 617 in your postlist.php script from this:

code:

SELECT t1.B_Number,t1.B_Parent,t1.B_Username,t1.B_Posted,t1.B_Last_Post,t1.B_Subject,t1.B_Main,t1.B_Status,t1.B_Approved,t1.B_Icon,t1.B_Reged,t1.B_Counter,t1.B_Sticky,t1.B_Replies,t1.B_Rating,t1.B_Rates,t1.B_RealRating,t2.U_Color,t2.U_Status



to this:

code:

SELECT t1.B_File,t1.B_Number,t1.B_Parent,t1.B_Username,t1.B_Posted,t1.B_Last_Post,t1.B_Subject,t1.B_Main,t1.B_Status,t1.B_Approved,t1.B_Icon,t1.B_Reged,t1.B_Counter,t1.B_Sticky,t1.B_Replies,t1.B_Rating,t1.B_Rates,t1.B_RealRating,t2.U_Color,t2.U_Status



and then changed line 690 from this:

code:

list($Number,$Parent,$Username,$Posted,$Last_Post,$Subject,$Main,$Open,$Approved,$icon,$Reged,$Counter,$Sticky,$Replies,$Rating,$Rates,$stars,$Color,$PostStatus) = $dbh -> fetch_array($sth);



to this:

code:

list($File,$Number,$Parent,$Username,$Posted,$Last_Post,$Subject,$Main,$Open,$Approved,$icon,$Reged,$Counter,$Sticky,$Replies,$Rating,$Rates,$stars,$Color,$PostStatus) = $dbh -> fetch_array($sth);



and then just above this on line 873:

code:

// Setup the postrow array



add this:

code:

if ($File) {
$Subject = "<img src="{$config['images'}/disk.gif" border="0" alt="$File" /> $Subject";
}



and that should do the trick.

You could also turn the disk.gif into a link to the file too.

Example:
code:

$Subject = "<a href="{$config['fileurl']}/$File"><img src="{$config['images'}/disk.gif" border="0" alt="$File" /></a> $Subject";



(ps. I haven't actually done this so it may not work... please let me know if it does... lol)

sjsaunders #219105 07/18/2002 10:29 PM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Thanks Lisa & Dave... the Stickey note thing is Awesome!

Dave, I think you're close on the Icon for an attachment... but....

There were a few typos.... which I was dosh garn impressed that I figured out.

This line:
$Subject = "<img src="{$config['images'}/disk.gif" border="0" alt="$File" /> $Subject";

Should be:
$Subject = "<img src="{$config['images']}/icons/disk.gif" border="0" alt="$File" /> $Subject";

Note to fill in the ] after 'images'
insert the subdirectory /icons/disk.gif
and the \ before the " after disk.gif

Seems to be working for me!

Thanks Dave!!!!

Daine #219106 07/18/2002 10:32 PM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
hehe thanks for the typo fixes. I just sorta winged it, didn't actually put the code in and test it. I'm glad it's working though. Others may find it usefull too.

Daine #219107 07/18/2002 10:48 PM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
BTW ...

It's not a biggie.... I think I prefer them having to view the post first to download the file.... especially if Rick is changing how the download of attachments works. But if you try the snippit of code you posted to make the disk link to the attachment, that works... but it kills the link to the thread.

FYI - Don't try it that way. But it works perfect with just the disk.

sjsaunders #219108 07/19/2002 12:40 AM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
You guys are all busy creating these great Hacks... THANKS!!!

I thought I'd try my hand and writing them up and posting them in the beta forum so others can try.

Here is the Sticky Thread hack.

Here is the Attachment Icon thread.

Gorlum #219109 10/18/2002 4:57 PM
Joined: Oct 2002
Posts: 2
Lurker
Lurker
Offline
Joined: Oct 2002
Posts: 2
sounds great this is just what i need BUT i dont have postlist.php i only have 3 php files all others are cgi im using Ultimate Bulletin BoardTM 6.2.1.2

aschmidt #219110 10/18/2002 5:40 PM
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
www.ubbdev.com is thataway my friend


- Allen wavey
- What Drives You?
Joined: Oct 2002
Posts: 2
Lurker
Lurker
Offline
Joined: Oct 2002
Posts: 2
hehe,thanks


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
JAISP
JAISP
PA
Posts: 449
Joined: February 2008
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 20221218)