Recent Topics

1 Dec 15, 2004 14:16    

This is a plugin that inserts a topic icon related to your post's main category.

INSTALL:
[list]

  • Edit variables in function topic_icon

  • Upload to your plugins/renderers directory

  • [/list:u]

    Download: [url=http://www.brotherson.com/downloads/details.php?file=2]HERE.[/url]
    More detail: [url=http://www.brotherson.com/index.php/2004/12/11/topic_icon_for_b2evolution] on my blog.[/url]
    Tested on : 0.9.0.11

    Please install if you want to try it out and let me know of any bugs you may find. It works for me, but that doesn't always guarantee that it works across the board.

    edit: fixed link broken by phpBB's parsing.

    2 Dec 15, 2004 16:04

    Thank you for reposting this, mattbta. I appreciate it, and I'm sure many others do as well. I hope to implement this on my site soon. Very nice-looking site by the way!

    3 Dec 17, 2004 01:59

    EdB requested subcats for this, which I figured out, if and only if your categories are created in order, IE my post on my blog for this is in categories tech --> code --> b2evolution and I created category tech before code before b2evolution.

    Change the $sql variable to :

    
    $sql = "SELECT ep.postcat_cat_ID, ec.cat_name ";
    				$sql .= "FROM evo_postcats ep ";
    				$sql .= "JOIN evo_categories ec ON (ep.postcat_cat_ID = ec.cat_id) ";
    				$sql .= "WHERE ep.postcat_post_ID IN ($Item->ID) ";
    				$sql .= "GROUP BY ep.postcat_post_ID, ep.postcat_cat_ID, ec.cat_name ";
    				$sql .= "ORDER BY ep.postcat_cat_ID DESC LIMIT 1 ";
    

    4 Dec 17, 2004 02:07

    Thanks. That'll work for my application.

    5 Dec 30, 2004 23:05

    I'm a complete newb, so excuse the incompetence...

    but I added the files and such, so now how do I get the icons into the page? What code do I have to add into _main.php to show the topic icon?

    6 Dec 31, 2004 00:08

    You don't have to add anything to the pages. You may have to do a mass update on the existing posts to insert my renderer into each post's renderer column. If you don't have too many posts, you can manually do this in backoffice.

    7 Dec 31, 2004 01:25

    oh! All right, thanks. I was a bit confused on that.

    8 Jan 06, 2005 14:01

    Thanks for this Matt, I've been looking for something like this for b2evolution for some time.

    I've made a couple of small alterations, both of which are in the topic_icon() function:

    1. I've added $imagename = ''; after the line $content = ''; to supress a warning when no images are found.

    2. I've changed the $align = "left"; line to:

    $style = "float: right; margin-left: 1em; margin-bottom: 1em; margin-top: -70px;";

    and then changed the use of $align to $style. This for XHTML compliance. Obviously change the $style declaration to suit your own tastes.

    9 Jan 08, 2005 07:52

    Well I would really like to use this on my [url=http://www.luna-fx.com/blog]Blog[/url] but don't fully understand it.

    I've uploaded it as a plugin and b2e is able to see it. But where do you put the files, and what do you have to name them?

    I made a folder called icon, which is found at www.luna-fx.com/icon

    In the code, I changed the url to http://www.luna-fx.com/icon , and the file path to /madsmhil/public_html/icon , and also just /home/madsmhil/public_html/icon (I tried both)

    I have a cat called General Info , so I made a test gif file called General_Info.gif , and uploaded it to my icon folder. I then made a new post, the plugin box was checked, put it under General info, and I see nothing on the post.

    Any ideas?

    10 Jan 08, 2005 14:31

    Well the first thing is to try is to either change the image name so it uses the prefix declared in $prefix on line 76. It's currently looking for an image called topic_general_info.gif, which doesn't exist. Give that a shot and LMK how it turns out.

    11 Jan 08, 2005 17:16

    I went and renamed the image to topic_general_info.gif

    made a new test post with the plugin activated, and still nothing. Even tried topic_General_Info.gif

    12 Jan 08, 2005 17:38

    Then i would suggest changing line 74 to:

    
     $topic_dir = "/home/madsmhil/public_html/icon/";
    


    You need the trailing slash.

    If that doesn't work, try:

    
     $topic_dir = "/icon/";
    

    13 Jan 08, 2005 17:45

    Gave both of those a try with the image name topic_general_info.gif

    But nothing is showing up

    Do you have to define this in CSS?

    14 Jan 08, 2005 18:45

    Hrmm...

    Nope, nothing should be needed in the css to get the image to show up.

    A view of your source shows that the plugin is functioning, it just can't find the image file -- <!--no icon-->

    how about

    
    $topic_dir = $DOCUMENT_ROOT."/icon/"; 
    

    15 Jan 08, 2005 20:55

    Got it working with /home/madsmhil/public_html/icon/

    I think I may have deleted the " " around it on accident which was keeping it from working.

    Anyway, works fine now. Just have to design some icons.

    ---

    Eh, I forgot IE is unable to display png images correctly, so it no longer matters.

    16 Jan 08, 2005 21:40

    Or maybe not. This is turning into a headache.

    It was working, so I moved the icon folder inside my blog, changed both lines to include the new folder, and now it can't find the image again.

    aye aye aye. I'll keep trying though, probably is something small.

    17 Jan 09, 2005 07:00

    Problem found

    i was doing my image names as topic_general_info.gif when it should have been topicgeneral_info.gif

    I have a question though. What would you have to modify in order to raise the icon to the top right. Right now it comes under the title / date (inside the post), but I would like it to be above those, in case of a short post. Then it owuld not overlap with the comment button.

    Basically, is there any way to insert it up there above the date, and then just align right? I can't find the code that tells it where to insert the image.

    18 Jan 09, 2005 13:48

    Right now, the way the plugins are designed is that they search the post's content for things and then either insert or replace those searched things with their own. Currently, there is no way to get it to put it by the post title, unless you wrote a case statement and hard-coded that within your _main.php

    19 Jan 11, 2005 07:17

    I guess this is a bit extreme, but would anyone be able to help me do this (if it is a simple task) If it's a bit complex, then no need to bother. Or at least give a short overview.

    I'm not exactly all that great with coding.

    20 Apr 01, 2005 11:48

    Error
    [DBIM] Connection Failed: Access denied for user 'webmaster'@'%' to database 'olate'
    Type: 256 File: E:\wwwroot\downloads\modules\core\dbim.php Line: 48 Debug Level: 1

    when trying to download it

    21 Apr 01, 2005 16:28

    Should be good to go, I forgot to move that table over on my server rebuild.

    22 Apr 07, 2005 17:51

    I have been looking for this!

    I am tring to get it to work, I am playing with the paths and so on, but I have 2 questions...

    If the main Cat is nested under another, will it work?

    What do the nake of the images have to be exacly to get it to work

    topic_test image.gif for the cat "test image"

    or do I have to define this somewhere cat by cat?

    Thanks!!!!!!

    23 Apr 08, 2005 06:50

    Okay I am giving up...

    *** Disclaimer, my blog is political in nature, I do not ask people to agree with me 100% of the time. ****

    Here is what I have...

    function topic_icon ($text) 
    {
    		global $Item, $DB;
    		
    		$topic_uri = "http://www.bushsamerica.com/icons2/";		//site url to images
            $topic_dir = "/icons2/";							//filepath to images
            $align = "left";													//image align
            $prefix = "topic";													//image prefix
            $filetype = ".gif";													//image filetype
    		$topiconclass = "topicon";											//image css class
            

    I am tring to add a cat banner at the top. My test Cat I am using is "Tom DeLay"

    If you go to my icon folder, you will see that I have the image almost any way I can...

    All I get in the source is

    <h2>04/08/05</h2>	<div class="bPost" lang="en-US">
    		
    		<div class="bSmallHead">
    
    		<a href="http://www.bushsamerica.com/index.php?p=0&amp;more=1&amp;c=1&amp;tb=1&amp;pb=1" title="Permanent link to full entry"><img src="img/icon_minipost.gif" alt="Permalink" width="12" height="9" class="middle" /></a>
    		Categories: <strong><a href="http://www.bushsamerica.com/index.php?cat=32" title="Browse category">Tom DeLay</a></strong> &nbsp; <img src="http://www.bushsamerica.com/img/flags/h10px/us.gif" alt="English (US)" class="flag" /> 		</div>
    		<h3 class="bTitle"></h3>
    		<div class="bText">
    		  <!--no icon-->	<p>asdasdasd
    </p>
    
    		  		</div>
    		<div class="bSmallPrint">
    			<a href="http://www.bushsamerica.com/index.php?p=0&amp;more=1&amp;c=1&amp;tb=1&amp;pb=1#comments" title="Display comments / Leave a comment">Leave a comment</a>	

    <!--no icon-->

    Do I have to fill out the

      if ($imagename) {
                    list($width, $height, $type, $attr) =
                    getimagesize($filename);
                    $content .= "<img src='" . $imagename . "'";
                    $content .= " align='" . $align . "'";
                    $content .= " width='" . $width . "'";
                    $content .= " height='" . $height . "'";
    				$content .= " class='" . $topiconclass . "'";
    				$content .= " alt='" .$linktitle . "'";
    				$content .= " title='" .$linktitle . "'";
                    $content .= " />\n";
            } else {
                    $content = "<!--no icon-->";


    part, I assume it is not even being looked at right now, because I am getting the else <!--no icon-->

    PS Any banners you see on my site are there manualy, that is why I think this plug in will rock!

    24 Apr 08, 2005 10:14

    Can you try changing

    $prefix = "topic";

    to

    $prefix = "topic_";

    and LMK if that works?

    25 Apr 08, 2005 17:19

    Worked! Sweet!!!!

    THANK YOU

    26 Sep 26, 2005 16:14

    This is what I have:

    $topic_uri = "http://home.hccnet.nl/van.denbroek/van.denbroek/images/avatars/"; //site url to images
    $topic_dir = "/van.denbroek/images/avatars/"; //filepath to images
    $align = "left"; //image align
    $prefix = "topic_"; //image prefix
    $filetype = ".gif"; //image filetype
    $topiconclass = "topicon"; //image css class

    But it doesn't work...

    27 Aug 18, 2007 23:29

    Hi -

    Looks like nobody really uses topicon. Is it still something that works? I'd like to install it, but if it's not been checked out with the most recent b2evo updates, then I'll just let it go.

    Thanks,

    Todd

    29 Aug 19, 2007 20:47

    What's the difference between this and the Avatars plugin?

    30 Aug 20, 2007 02:43

    Looking at the link in the first post this plugin was for b2evo 0.9 and only did categories, the avatars plugin does icons for users, posts, categories, and blogs, and runs on b2evo 1.10.


    Form is loading...