The forum of the forums

Would you like to react to this message? Create an account in a few clicks or log in to continue.
The forum of the forums
4 posters

    Colorize cell wont work

    TheCrow
    TheCrow
    Manager
    Manager


    Male Posts : 6916
    Reputation : 795
    Language : Greek, English

    Solved Colorize cell wont work

    Post by TheCrow 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.
    _Twisted_Mods_
    _Twisted_Mods_
    Helper
    Helper


    Male Posts : 2083
    Reputation : 336
    Language : English
    Location : Ms

    Solved Re: Colorize cell wont work

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

    can u provide the code you are using
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: Colorize cell wont work

    Post by Ange Tuteur 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.
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: Colorize cell wont work

    Post by Van-Helsing 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
    TheCrow
    TheCrow
    Manager
    Manager


    Male Posts : 6916
    Reputation : 795
    Language : Greek, English

    Solved Re: Colorize cell wont work

    Post by TheCrow 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://2img.net/i/fa/subsilver/icon_newest_reply.gif"]').closest('tr').addClass('newpost');
      $('img[src="http://2img.net/i/fa/prosilver/icon_post_target_unread.gif"]').closest('tr').addClass('newpost');
    });
    Colorize cell wont work MwzhC30 Colorize cell wont work YbjbYtt

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



    Colorize cell wont work Thecro10
     Forum of the Forums

    Forumotion Rules | Tips & Tricks |
    FAQ | Did you forget your password?



    *** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
    No support via PM!
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: Colorize cell wont work

    Post by Van-Helsing 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
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: Colorize cell wont work

    Post by Ange Tuteur 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.
    TheCrow
    TheCrow
    Manager
    Manager


    Male Posts : 6916
    Reputation : 795
    Language : Greek, English

    Solved Re: Colorize cell wont work

    Post by TheCrow 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?



    Colorize cell wont work Thecro10
     Forum of the Forums

    Forumotion Rules | Tips & Tricks |
    FAQ | Did you forget your password?



    *** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
    No support via PM!
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: Colorize cell wont work

    Post by Ange Tuteur 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
    TheCrow
    TheCrow
    Manager
    Manager


    Male Posts : 6916
    Reputation : 795
    Language : Greek, English

    Solved Re: Colorize cell wont work

    Post by TheCrow October 14th 2014, 4:29 pm

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



    Colorize cell wont work Thecro10
     Forum of the Forums

    Forumotion Rules | Tips & Tricks |
    FAQ | Did you forget your password?



    *** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
    No support via PM!
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: Colorize cell wont work

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

    Yes, you are correct. Wink
    TheCrow
    TheCrow
    Manager
    Manager


    Male Posts : 6916
    Reputation : 795
    Language : Greek, English

    Solved Re: Colorize cell wont work

    Post by TheCrow 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! :/



    Colorize cell wont work Thecro10
     Forum of the Forums

    Forumotion Rules | Tips & Tricks |
    FAQ | Did you forget your password?



    *** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
    No support via PM!
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: Colorize cell wont work

    Post by Ange Tuteur 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};">
    TheCrow
    TheCrow
    Manager
    Manager


    Male Posts : 6916
    Reputation : 795
    Language : Greek, English

    Solved Re: Colorize cell wont work

    Post by TheCrow 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...



    Colorize cell wont work Thecro10
     Forum of the Forums

    Forumotion Rules | Tips & Tricks |
    FAQ | Did you forget your password?



    *** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
    No support via PM!
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: Colorize cell wont work

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

    This image ?
    Colorize cell wont work Captu179

    or the new post one ?
    TheCrow
    TheCrow
    Manager
    Manager


    Male Posts : 6916
    Reputation : 795
    Language : Greek, English

    Solved Re: Colorize cell wont work

    Post by TheCrow 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.
    Colorize cell wont work RZtKY1u
    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
    Colorize cell wont work N6xLhOu



    Colorize cell wont work Thecro10
     Forum of the Forums

    Forumotion Rules | Tips & Tricks |
    FAQ | Did you forget your password?



    *** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
    No support via PM!
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: Colorize cell wont work

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

    Could you provide your CSS rule ?

    Thanks
    TheCrow
    TheCrow
    Manager
    Manager


    Male Posts : 6916
    Reputation : 795
    Language : Greek, English

    Solved Re: Colorize cell wont work

    Post by TheCrow 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; }



    Colorize cell wont work Thecro10
     Forum of the Forums

    Forumotion Rules | Tips & Tricks |
    FAQ | Did you forget your password?



    *** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
    No support via PM!
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: Colorize cell wont work

    Post by Ange Tuteur 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%)
    TheCrow
    TheCrow
    Manager
    Manager


    Male Posts : 6916
    Reputation : 795
    Language : Greek, English

    Solved Re: Colorize cell wont work

    Post by TheCrow 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.
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: Colorize cell wont work

    Post by Ange Tuteur 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;
    }
    TheCrow
    TheCrow
    Manager
    Manager


    Male Posts : 6916
    Reputation : 795
    Language : Greek, English

    Solved Re: Colorize cell wont work

    Post by TheCrow October 14th 2014, 5:32 pm

    I have to have both javascripts right?



    Colorize cell wont work Thecro10
     Forum of the Forums

    Forumotion Rules | Tips & Tricks |
    FAQ | Did you forget your password?



    *** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
    No support via PM!
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: Colorize cell wont work

    Post by Ange Tuteur 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.
    TheCrow
    TheCrow
    Manager
    Manager


    Male Posts : 6916
    Reputation : 795
    Language : Greek, English

    Solved Re: Colorize cell wont work

    Post by TheCrow 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">')});



    Colorize cell wont work Thecro10
     Forum of the Forums

    Forumotion Rules | Tips & Tricks |
    FAQ | Did you forget your password?



    *** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
    No support via PM!
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: Colorize cell wont work

    Post by Ange Tuteur 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.
    TheCrow
    TheCrow
    Manager
    Manager


    Male Posts : 6916
    Reputation : 795
    Language : Greek, English

    Solved Re: Colorize cell wont work

    Post by TheCrow October 14th 2014, 6:05 pm

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



    Colorize cell wont work Thecro10
     Forum of the Forums

    Forumotion Rules | Tips & Tricks |
    FAQ | Did you forget your password?



    *** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
    No support via PM!
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: Colorize cell wont work

    Post by Ange Tuteur 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;
    }
    TheCrow
    TheCrow
    Manager
    Manager


    Male Posts : 6916
    Reputation : 795
    Language : Greek, English

    Solved Re: Colorize cell wont work

    Post by TheCrow October 14th 2014, 6:16 pm

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



    Colorize cell wont work Thecro10
     Forum of the Forums

    Forumotion Rules | Tips & Tricks |
    FAQ | Did you forget your password?



    *** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
    No support via PM!
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: Colorize cell wont work

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

    You're welcome ^^

    Topic archived

    Have a great day Smile

      Current date/time is November 11th 2024, 9:15 pm