vForums Support Banner



 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Code Requests & Support :: Different new/old images for certain boards - View Topic
Topic Rating: *****
Printable View
Aiken
Full Member
***

[Avatar]

Posts: 333
Status: Offline
Gender: Male
Location: In a very lonely place, the domain of despair
Age: 35
Joined:  
Reputation: 12%  


pmtwitterskypemsnyahooxfire
Different new/old images for certain boards (13th Dec 09 at 7:28pm UTC)
Resolved
Would it be possible to have a code to change the new/old images for specific boards, this will be used for like guild boards on my forum where the new/old images are the icon/logo for their guild
The code must work for sub-boards, I saw a code similar to this but it wouldn't work for the sub-board, when I tried it changed for the board that the sub-board was in

Example:

My guild on my forum is called Crimson Lotus with these images:

Title:
Image
for the group image

New:
Image

Old:
Image


vF forums:
Perfect World RP
BLEACH Universe - Under Construction / Testing Phase
Xen Qarna RP - Stage I
Vyren Entar Battle Network RP - Under Construction / Maintenance Mode Enabled
the Final Anime Hideout
Aiken
Full Member
***

[Avatar]

Posts: 333
Status: Offline
Gender: Male
Location: In a very lonely place, the domain of despair
Age: 35
Joined:  
Reputation: 12%  


pmtwitterskypemsnyahooxfire
Re: Different new/old images for certain boards (15th Dec 09 at 9:57pm UTC)
A reply would really help

vF forums:
Perfect World RP
BLEACH Universe - Under Construction / Testing Phase
Xen Qarna RP - Stage I
Vyren Entar Battle Network RP - Under Construction / Maintenance Mode Enabled
the Final Anime Hideout
Ross
Administrator
*****

[Avatar]

Posts: 3,709
Status: Offline
Gender: Male
Age: 9 14
Joined:  

Additional Groups:
Support Team
***


Reputation: 45%  


pmwwwtwittergtalkvForum
Re: Different new/old images for certain boards (15th Dec 09 at 11:51pm UTC)
Hi,

I will reply to this in the morning. There's a couple of ways it could be done and I'd like to check which is the most efficient.


Image
Ross
Administrator
*****

[Avatar]

Posts: 3,709
Status: Offline
Gender: Male
Age: 9 14
Joined:  

Additional Groups:
Support Team
***


Reputation: 45%  


pmwwwtwittergtalkvForum
Re: Different new/old images for certain boards (16th Dec 09 at 10:00am UTC)
Hi,

I think this is the most efficient way of achieving that.

Firstly, in your global header, enter this piece of code. Repeat the lines in red as many times as necessary, entering the board id and images urls where indicated:

<script type="text/javascript">
<!--
var unread_board_images = new Array();
    unread_board_images["general"] = new Array("Read Image URL", "Unread Image URL");
    unread_board_images["board-id"] = new Array("Another Read Image URL", "Another Unread Image URL");


function unread_board_image(board_id, has_new_posts, default_image) {
    if("undefined" != typeof unread_board_images[board_id]) {
        if(has_new_posts) {
            document.write('<img src="'+ unread_board_images[board_id][1] +'" alt="New Posts" />');
        } else {
            document.write('<img src="'+ unread_board_images[board_id][0] + '" alt="No New Posts" />');
        }
    } else {
        document.write(default_image);
    }
}
//-->
</script>


And then, in your board template (Admin -> Manage Templates -> Board Listing), enter this where the new posts image should appear. There's no need to change any parts of it.

<script type="text/javascript"> unread_board_image('{board_id}', {has_new_posts}, '{new_posts}'); </script>

Image
Aiken
Full Member
***

[Avatar]

Posts: 333
Status: Offline
Gender: Male
Location: In a very lonely place, the domain of despair
Age: 35
Joined:  
Reputation: 12%  


pmtwitterskypemsnyahooxfire
Re: Different new/old images for certain boards (16th Dec 09 at 1:43pm UTC)
Great, I think this should be in the database so other people can use it

vF forums:
Perfect World RP
BLEACH Universe - Under Construction / Testing Phase
Xen Qarna RP - Stage I
Vyren Entar Battle Network RP - Under Construction / Maintenance Mode Enabled
the Final Anime Hideout
 Printable View

All times are GMT+0 :: The current time is 3:51am
Page generated in 0.3344 seconds
This Forum is Powered By vForums (v2.4)
Create a Forum for Free | Find Forums