The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Colorize cell wont work

View previous topic View next topic Go down

Solved Colorize cell wont work

Post by Luffy on October 13th 2014, 11:52 pm

Hello,
Via the new tutorial Ange provided, i tried adding the codes and instead of a background color to be a background image. But unfortunately the code wont work.
My forum website: http://informationforumgr.forumgreek.com/forum
Forum Version: PunBB

Regards,
MrMind.

Luffy
Manager
Manager

Male Posts : 4035
Reputation : 407
Language : Greek, English
Location : Greece

http://www.thinktankforum.net

Back to top Go down

Solved Re: Colorize cell wont work

Post by _Twisted_Mods_ on October 14th 2014, 2:01 am

can u provide the code you are using

_Twisted_Mods_
Helper
Helper

Male Posts : 2020
Reputation : 299
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Solved Re: Colorize cell wont work

Post by Ange Tuteur on October 14th 2014, 2:10 am

Hello MrMind,

Did you use the background property instead of background-color ? ( You can use background-image too )
Code:
tr.newpost td { background:url('IMG_SRC') !important }

Replace IMG_SRC by the URL of your image.

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2684
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Colorize cell wont work

Post by Van-Helsing on October 14th 2014, 2:39 am

Hello all,
I have test it on my forum and working fine the problem with Mr. Mind's forum is because he has removed the icons of the forum near categories (on the left) here is an example of my forum http://prntscr.com/4vykuj . The javascript reads this icon of each forum row.

Furthermore the javascript can be work in subforums too by changing the second image url in it.

Code:

$(function() {
$('img[src="IMAGE URL"]').closest('tr').addClass('newpost');
$('img[src="IMAGE URL"]').closest('tr').addClass('newpost');
});
In the second IMAGE URL you can colorize the icon of post with new replies like this http://prntscr.com/4vylxn .

Finally check the checkboxes in homepage and in subforums.

Best Regards,
Black-Shadow

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Colorize cell wont work

Post by Luffy on October 14th 2014, 9:07 am

Hello all,

@thetwistedkilla: the codes i am using are the same as the ones Ange provided in the tutorial.
@Ange: Yes i tried that. My problem is that i am trying only to add an image instead of the row color because i have the row color already. I don't know why it won't take it. Which image am images am i supposed to add in the js? The one for the last post and the one for the sub_category new icon? Or the ones Black Shadow showed?
@Black Shadow: The tutorial does not say that i must add the icon for the row that you showed but i will wait for Ange to tell me what i am doing wrong!

Here is exactly what i am using:
JAVASCRIPT:
Code:
$(function() {
  $('img[src="http://illiweb.com/fa/subsilver/icon_newest_reply.gif"]').closest('tr').addClass('newpost');
  $('img[src="http://illiweb.com/fa/prosilver/icon_post_target_unread.gif"]').closest('tr').addClass('newpost');
});


CSS:
Code:
tr.newpost td {background:url(https://cdn2.iconfinder.com/data/icons/Siena/48/label_new.png) no-repeat !important;}






Luffy
Manager
Manager

Male Posts : 4035
Reputation : 407
Language : Greek, English
Location : Greece

http://www.thinktankforum.net

Back to top Go down

Solved Re: Colorize cell wont work

Post by Van-Helsing on October 14th 2014, 11:06 am

Hello Mr. Mind,
The javascript works with these icons http://prntscr.com/4w1buw for the board index and for these icons http://prntscr.com/4w1ck0 in subforums.

Best Regards,
Black-Shadow

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Colorize cell wont work

Post by Ange Tuteur on October 14th 2014, 2:57 pm

Black-Shadow provided you with the correct info. For the index you would use the "Icons for the forum." There's two for you to include the category and forum icon.

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2684
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Colorize cell wont work

Post by Luffy on October 14th 2014, 4:25 pm

Those icons are not displayable in the forum index or the subforum preview. They must be visible so the code to work?






Luffy
Manager
Manager

Male Posts : 4035
Reputation : 407
Language : Greek, English
Location : Greece

http://www.thinktankforum.net

Back to top Go down

Solved Re: Colorize cell wont work

Post by Ange Tuteur on October 14th 2014, 4:28 pm

They must, at the very least exist in the HTML document. They can be hidden by CSS, but if they are not in the document it wont work. Wink

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2684
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Colorize cell wont work

Post by Luffy on October 14th 2014, 4:29 pm

SO i can have them visible to the forum but with opacity 0 correct?






Luffy
Manager
Manager

Male Posts : 4035
Reputation : 407
Language : Greek, English
Location : Greece

http://www.thinktankforum.net

Back to top Go down

Solved Re: Colorize cell wont work

Post by Ange Tuteur on October 14th 2014, 4:32 pm

Yes, you are correct. Wink

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2684
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Colorize cell wont work

Post by Luffy on October 14th 2014, 4:34 pm

Ok what is the element for those icons for the index?
For the subforums icon i set them with opacity 0 but i don't know the element for the index icons! :/






Luffy
Manager
Manager

Male Posts : 4035
Reputation : 407
Language : Greek, English
Location : Greece

http://www.thinktankforum.net

Back to top Go down

Solved Re: Colorize cell wont work

Post by Ange Tuteur on October 14th 2014, 4:38 pm

In the index_box template, it should be :
Code:
                     <span class="status" style="margin-right: -{catrow.forumrow.INC_WIDTH_ICON}; margin-left: -{catrow.forumrow.INC_WIDTH_ICON};">
                        <img title="{catrow.forumrow.L_FORUM_FOLDER_ALT}" src="{catrow.forumrow.FORUM_FOLDER_IMG}" alt="{catrow.forumrow.L_FORUM_FOLDER_ALT}" />
                     </span>

Inside :
Code:
<td class="tcl" style="padding-right: {catrow.forumrow.INC_LEVEL_RIGHT}; padding-left: {catrow.forumrow.INC_LEVEL_LEFT};">

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2684
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Colorize cell wont work

Post by Luffy on October 14th 2014, 4:39 pm

Ok yes i added that. But still with that and set to opacity 0 the image i wont is not visible...






Luffy
Manager
Manager

Male Posts : 4035
Reputation : 407
Language : Greek, English
Location : Greece

http://www.thinktankforum.net

Back to top Go down

Solved Re: Colorize cell wont work

Post by Ange Tuteur on October 14th 2014, 4:48 pm

This image ?


or the new post one ?

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2684
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Colorize cell wont work

Post by Luffy on October 14th 2014, 4:58 pm

No. This is the image i want to be visible as soon as a post is posted instead of a background color.

But i get it 3 times instead of once. And also the one i want is not visible.
I only want this one to be visible







Luffy
Manager
Manager

Male Posts : 4035
Reputation : 407
Language : Greek, English
Location : Greece

http://www.thinktankforum.net

Back to top Go down

Solved Re: Colorize cell wont work

Post by Ange Tuteur on October 14th 2014, 5:00 pm

Could you provide your CSS rule ?

Thanks

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2684
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Colorize cell wont work

Post by Luffy on October 14th 2014, 5:02 pm

Ofc.
Code:
tr.newpost td{ background:url(http://i39.servimg.com/u/f39/18/45/97/69/oo10.png) no-repeat !important;z-index:1!important; }






Luffy
Manager
Manager

Male Posts : 4035
Reputation : 407
Language : Greek, English
Location : Greece

http://www.thinktankforum.net

Back to top Go down

Solved Re: Colorize cell wont work

Post by Ange Tuteur on October 14th 2014, 5:18 pm

Try this :
Code:
tr.newpost { background:url(http://i39.servimg.com/u/f39/18/45/97/69/oo10.png) no-repeat 100% 0% !important }

Since it's a background image, the z-index property wont work. Your description icons would need moving around, or you could place the image elsewhere. Adjust the percentages to move the image around. (100% 0%)

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2684
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Colorize cell wont work

Post by Luffy on October 14th 2014, 5:22 pm

I want it to be over the image of the category. Only there.

Edit: To be exact, set the background 2% (for the one you sent) and you will see where i want the left image only to be.

Luffy
Manager
Manager

Male Posts : 4035
Reputation : 407
Language : Greek, English
Location : Greece

http://www.thinktankforum.net

Back to top Go down

Solved Re: Colorize cell wont work

Post by Ange Tuteur on October 14th 2014, 5:30 pm

Weeell, you could add it in by JavaScript :
Modules > JavaScript codes management > Create a new script

Title : Your choice
Placement : In the home page (and anywhere else you want it to work)
Paste the code below and submit :
Code:
$(function() {$('tr.newpost').append('<img class="newImg" src="http://i39.servimg.com/u/f39/18/45/97/69/oo10.png">')});

Then add this to CSS :
Display > Colors > CSS stylesheet
Code:
tr.newpost { position:relative }
tr.newpost .newImg {
 position:absolute;
 left:8px;
 top:0;
}

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2684
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Colorize cell wont work

Post by Luffy on October 14th 2014, 5:32 pm

I have to have both javascripts right?






Luffy
Manager
Manager

Male Posts : 4035
Reputation : 407
Language : Greek, English
Location : Greece

http://www.thinktankforum.net

Back to top Go down

Solved Re: Colorize cell wont work

Post by Ange Tuteur on October 14th 2014, 5:39 pm

Yes, but you could add this :
Code:
$(function() {$('tr.newpost').append('<img class="newImg" src="http://i39.servimg.com/u/f39/18/45/97/69/oo10.png">')});

In with the one that checks for the images. It would have to be after those I believe.

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2684
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Colorize cell wont work

Post by Luffy on October 14th 2014, 5:57 pm

The position:absolute for the second one took the image where the logo is. So i removed it and i set it where i wanted it to be to fix this. But i noticed that when i zoom in or out it moved from there it should be..
Now i have this code in the CSS:
Code:
tr.newpost { position:relative }
tr.newpost .newImg {margin-left: -759px;
margin-top: 6px!important;
}

and this in the java:
Code:
$(function() {$('tr.newpost').append('<img class="newImg" src="http://i39.servimg.com/u/f39/18/45/97/69/oo610.gif">')});






Luffy
Manager
Manager

Male Posts : 4035
Reputation : 407
Language : Greek, English
Location : Greece

http://www.thinktankforum.net

Back to top Go down

Solved Re: Colorize cell wont work

Post by Ange Tuteur on October 14th 2014, 6:01 pm

weird, try replacing your CSS with this :
Code:
tr.newpost { position:relative !important }
tr.newpost .newImg {
  position:absolute;
  left:8px;
  top:0;
}

The first rule might need to be important, so the absolute children stay inside their parents.

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2684
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Colorize cell wont work

Post by Luffy on October 14th 2014, 6:05 pm

i left it for you to see. Its at the top again.






Luffy
Manager
Manager

Male Posts : 4035
Reputation : 407
Language : Greek, English
Location : Greece

http://www.thinktankforum.net

Back to top Go down

Solved Re: Colorize cell wont work

Post by Ange Tuteur on October 14th 2014, 6:12 pm

Try changing the script to :
Code:
$(function() {$('tr.newpost td.tcl').append('<img class="newImg" src="http://i39.servimg.com/u/f39/18/45/97/69/oo610.gif">')});

and the CSS to :
Code:
tr.newpost td.tcl { position:relative !important }
tr.newpost td.tcl .newImg {
  position:absolute;
  left:8px;
  top:0;
}

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2684
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Colorize cell wont work

Post by Luffy on October 14th 2014, 6:16 pm

left:4px and it worked! Many many thanks!
Topic Solved! :rose:






Luffy
Manager
Manager

Male Posts : 4035
Reputation : 407
Language : Greek, English
Location : Greece

http://www.thinktankforum.net

Back to top Go down

Solved Re: Colorize cell wont work

Post by Ange Tuteur on October 14th 2014, 6:24 pm

You're welcome ^^

Topic archived

Have a great day Smile

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2684
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum