Author |
Topic  |
|
sr_erick
Senior Member
   
USA
1318 Posts |
Posted - 01 November 2004 : 19:29:19
|
Hello,
Anyone care to give a quick rundown of how the new post icon works? Which function is called and what needs to be sent to it? I'm having difficulty figuring this one out for use on my Sub-Forum mod. Thanks. |


Erick Snowmobile Fanatics
|
|
Davio
Development Team Member
    
Jamaica
12217 Posts |
Posted - 01 November 2004 : 19:33:08
|
function getCurrentIcon(fIconName, fAltText, fOtherTags)
Arguments fIconName - A string containing the icon's filename, width and height, separated with pipe characters (|): "icon_filename|width|height" Note: The icon must be placed inside your image folder
fAltText - Text that will appear both as a replacement for text-only browsers and as a tooltip for HTML4 browsers.
fIconName - Other HTML attributes that you want for the icon, e.g., "align=center" or "border=1"
Returns An <IMG> tag containing the proper HTML attributes.
Description Used to display icons with the correct image URL and HTML attributes.
Example: Const strIconFolder = "icon_folder.gif|15|15" getCurrentIcon(strIconFolder,"Old Topic","align=center")
'Returns: <img src="images/icon_folder.gif" width="15" height="15" alt="Old Topic" title="Old Topic" align=center />
This was brought to you by the Snitz Forum Mod Guide, which is still in development  |
Support Snitz Forums
|
Edited by - Davio on 01 November 2004 19:35:06 |
 |
|
sr_erick
Senior Member
   
USA
1318 Posts |
Posted - 01 November 2004 : 20:30:00
|
I'm confused. Don't you need to send the last reply or topic id from a particular forum and compare it with the last visit which it in the cookie? This will get me either a standard or purple folder icon.
I guess I know how to call an icon, I need to know when to call which icon depending if the particular forum has anything new since the users last visit. |


Erick Snowmobile Fanatics
|
 |
|
Davio
Development Team Member
    
Jamaica
12217 Posts |
Posted - 01 November 2004 : 20:52:54
|
Oh, sorry. Guess I didn't understand your question clearly.
The ChkIsNew() function in the inc_func_chknew.asp file, is the function that is called to display the purple or yellow icons. It checks the current date with the date you last visited and determines if it is purple or yellow icon that needs to be displayed. |
Support Snitz Forums
|
 |
|
RichardKinser
Snitz Forums Admin
    
USA
16655 Posts |
Posted - 01 November 2004 : 20:54:11
|
take a look at the inc_func_chknew.asp file and also, in the active.asp file around line #510 |
 |
|
Davio
Development Team Member
    
Jamaica
12217 Posts |
Posted - 01 November 2004 : 20:57:47
|
Function ChkIsNew(dt)
Arguments dt - The date of the last topic posted to the forum
Returns This function will return a <IMG /> tag.
Description This function is used to retrieve the correct folder icon for the current topic. It returns the correct image tag for the topic depending on the following reasons: - whether a new post has been made to the topic since the last time you visited the forum - how many replies are in the topic - and whether the topic is moderated or not.
It also assumes that a variable called Topic_Author has been set in your file, with the value from the T_AUTHOR field in the TOPICS table. If the variable Topic_Author is found to be empty, the function will look in a recordset [rs("T_AUTHOR")] for the value.
Notes This function calls the ChkIsNew1() function if the topic contains moderated posts. It calls the ChkIsNew2() function if there are NO moderated posts. |
Support Snitz Forums
|
 |
|
sr_erick
Senior Member
   
USA
1318 Posts |
Posted - 01 November 2004 : 22:04:06
|
Edit: Guess I can't call that function from within a subroutine then. I can't set the Topic_Author variable in the subroutine and make it work, I have to set it before the subroutine which sucks. Now what to do... |


Erick Snowmobile Fanatics
|
Edited by - sr_erick on 01 November 2004 22:06:41 |
 |
|
sr_erick
Senior Member
   
USA
1318 Posts |
Posted - 01 November 2004 : 22:14:30
|
Err, nevermind that. I got it figured out. Thanks for the help! Also, looks like a nice little function guide. I'd like to see the whole thing. I was frusterated with dates and stuff tonight being they aren't stored in the database as a date. I then discovered the DateToString and StringToDate functions which cooled me down. Good thing those were there, didn't feel like converting strings. It would be nice to see a list of all functions so it's easier to make mods, instead of duplicating work. |


Erick Snowmobile Fanatics
|
 |
|
|
Topic  |
|