Not signed in (Sign In)

Categories

Vanilla 1.1.5 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    •  
      CommentAuthorsteviehype
    • CommentTimeSep 3rd 2006 edited
     # 1
    Hi,

    Does anyone know and therefore tell me, what the code is to put a Web Feed icon next to the Panel Title in the RSS2 add-on?
    Everything I try doesn't seem to work, but I'm rubbish at PHP!

    I'd like the Panel to say "Feeds    " I've tried putting in various different code into this line of the default.php:

    $Head->AddString("<link rel=\"alternate\" type=\"application/rss+xml\"
    href=\"".$FeedUrl."\" title=\"".$Context->GetDefinition("RSS2Feed")."\" />");


    I know that this would put the image next to the word RSS in the list, but I thought if I could get it to do that then I might be able to get it to appear in the Panel Header.

    Thanks in advance.

    S
  1.  # 2
    If you want it to appear next to the Feeds word, you need to open up the RSS2/default.php file, find this line:
    $FeedText = $Context->GetDefinition("Feeds");
    and change it to:
    $FeedText = $Context->GetDefinition("Feeds").' <a href="'.$FeedUrl.'"><img src="SOURCETOTHELITTLEFEEDIMAGE"></a>';
    then remove this line:
    $Panel->AddListItem($FeedText,
    $Context->GetDefinition("RSS2Feed"),
    $FeedUrl);
    And i think that should do the trick. Let me know how it goes.
    •  
      CommentAuthorsteviehype
    • CommentTimeSep 3rd 2006
     # 3
    Thanks for your reply Minisweeper, Unfortunately it didn't work.

    Any other suggestions.

    Thanks
  2.  # 4
    Did it do anything?
    •  
      CommentAuthorsteviehype
    • CommentTimeSep 3rd 2006
     # 5
    Nothing at all. I'm using jazzman's green theme, but I tried looking at it in the default theme but still nothing.
  3.  # 6
    so it didnt even remove the RSS2 link in the list? you must have done something wrong..?
    •  
      CommentAuthorsteviehype
    • CommentTimeSep 3rd 2006
     # 7
    I don't think I'm doing anything wrong but heres the code I have after your suggestion:

    $FeedText = $Context->GetDefinition("Feeds").' <a href="'.$FeedUrl.'"><img src="http://www.mydomain.co.uk/images/rss.png"></a>';
    $Panel->AddList($FeedText, 100);

    $Head->AddString("<link rel=\"alternate\" type=\"application/rss+xml\" href=\"".$FeedUrl."\" title=\"".$Context->GetDefinition("RSS2Feed")."\" />");


    and this is the original code:

    $FeedText = $Context->GetDefinition("Feeds");
    $Panel->AddList($FeedText, 100);
    $Panel->AddListItem($FeedText,
    $Context->GetDefinition("RSS2Feed"),
    $FeedUrl);
    $Head->AddString("<link rel=\"alternate\" type=\"application/rss+xml\" href=\"".$FeedUrl."\" title=\"".$Context->GetDefinition("RSS2Feed")."\" />");


    Have I missed something?

    Thanks for your time on this Minisweeper.
  4.  # 8
    Yeah that's right. I dont see how that's not working.

    What if you swap this:
    $FeedText = $Context->GetDefinition("Feeds").' <a href="'.$FeedUrl.'"><img src="http://www.mydomain.co.uk/images/rss.png"></a>';
    $Panel->AddList($FeedText, 100);
    for this:
    $FeedText = $Context->GetDefinition("Feeds").' <a href="'.$FeedUrl.'"><img src="http://www.mydomain.co.uk/images/rss.png"></a>';
    $Panel->AddString($FeedText, 100);
    •  
      CommentAuthorsteviehype
    • CommentTimeSep 3rd 2006
     # 9
    I'm still getting no change. :(

    I'm cleaning the cache each time and tried it in multiple browsers.
    • CommentAuthorSirNot
    • CommentTimeSep 3rd 2006 edited
     # 10
    Firstly, change back the extension to however it was by default. Then, go into conf/language.php and add the line:$Context->Dictionary['Feeds'] = 'Feeds <img src="IMAGE URL" alt="" />'; (inside the php tags, obviously)
    •  
      CommentAuthorDinoboff
    • CommentTimeSep 3rd 2006 edited
     # 11
    Mark should allow to add attributes to a List. You could that way add a class this list and apply feed logo as background of it.

    If you can add the logo to the list item, you edit line 55:
    $Panel->AddListItem($FeedText,
    $Context->GetDefinition("RSS2Feed"),
    $FeedUrl, "", " class=\"RSS2Feed\");
    •  
      CommentAuthorsteviehype
    • CommentTimeSep 3rd 2006
     # 12
    Thanks SirNot, that worked fine.

    Dinoboff, thanks for your reply, I might experiment with that.

    Minisweeper, Thanks for your time on this.

    Hooray it works. :)
    •  
      CommentAuthorsteviehype
    • CommentTimeSep 3rd 2006
     # 13
    I've just had a thought, could I do the same thing for the feedreader add-on?

    I'm looking at the code and I can't figure out how to do it.

    I'd really appreciate if someone could just point out where I could put the image tag.

    Thanks.
    • CommentAuthorSirNot
    • CommentTimeSep 3rd 2006
     # 14
    Take a look at line 183, and change it to something like this:$Panel->AddList($channel_title.' <img src="SOME IMAGE" alt="" />', 10);
    •  
      CommentAuthorsteviehype
    • CommentTimeSep 3rd 2006 edited
     # 15
    [edit]

    Ok, that doesn't seem to work. It does however move the panel to the top page. I have the feedreader panel set at 12, I changed the panel ordering but I don't think that will effect this though.
    • CommentAuthorSirNot
    • CommentTimeSep 3rd 2006
     # 16
    Oops, my bad. Change that line back, then add above it:$channel_title .= ' <img src="IMAGE" alt="" />';
    •  
      CommentAuthorsteviehype
    • CommentTimeSep 3rd 2006
     # 17
    Nice one, that worked a treat.

    Thanks again SirNot. :)
    • CommentAuthorMinisweeper
    • CommentTimeSep 3rd 2006 edited
     # 18
    I'm not sure why i didnt think of doing it your way, sirnot, but is there any reason my way shouldnt work? Just curious for myself..
    • CommentAuthorSirNot
    • CommentTimeSep 3rd 2006 edited
     # 19
    Well the problem with your approach is that there are multiple places within RSS2 and Atom extensions where $Panel->AddList (and, before it, $Context->GetDefinition('Feeds')) is called, so you'd have to go through and change every spot it could add a list to the side panel. In addition, if you also had the Atom extension enabled, you'd have to be sure that all three instances were modified in the same way, otherwise it'd appear under a different list name. Obviously, simply changing the definition is a lot easier.

    I believe the reason your idea probably didn't work is because that a) you added in the wrong spot and/or b) you took away the $Panel->AddListItem call.
  5.  # 20
    Ahh ok. I didnt realise it added it in more than one place. My bad.
    •  
      CommentAuthorsteviehype
    • CommentTimeSep 3rd 2006
     # 21
    Ok people, sorry to keep pestering you.

    I was doing this all on a mac in safari earlier and all looked lovely. I've just managed to have a look at the newly added icons in IE6 and firefox on mac and PC. In those browsers the icons came out like this:



    but on the mac they look like they are supposed too:



    I admit that I am using align="right" in the image code that SirNot gave to me, but I couldn't think of a quick way of doing this differently.

    How do I go about fixing this problem? Do I wrap the img tags in div's then alter them in the css file?

    Thanks again
    •  
      CommentAuthorsteviehype
    • CommentTimeSep 3rd 2006
     # 22
    I've taken out the align attributes and thought controlling the icons with the css was a much better way.
    But I still have the problem.
    The icons without any styling sit perfectly inline with the text right after the word has finished. I've tried to float the icons right but then the same problem as above occurs.
    I was trying this code:
    #Panel img {
    float: right;
    margin-top: -15px;
    }

    It works all the browsers minus Safari where the opposite happens, the images are 15px over the Panel! grrrrrr

    I'm not great at all this so if someone could help me sort this, I'd be very grateful.

    :) Thanks
    •  
      CommentAuthorsteviehype
    • CommentTimeSep 3rd 2006
     # 23
    Well, I can't figure this out at all, I guess another option would be to put the icons on the left hand side instead of on the right.

    The RSS Feeds icon is easy to change but I'm finding the Feedreader Icon a bit tricker.

    SirNot, where would I put your code for the icon to show up before the Panel title?

    But better yet if anyone can get them to stay on the right hand side, that would be better.

    Thanks
Add your comments
    Username Password
  • Format comments as