View previous topic :: View next topic |
Author |
Message |
Marzar00
Joined: 19 Oct 2003 Posts: 7
|
Posted: Sun Oct 19, 2003 3:10 am Post subject: Topic Icons |
|
|
I was wondering if anyone has developed a script that when creating news you select a catogory and when posted the catogory name appears as normal but also an image relevant to that catagory. I have made an example:
Thanks for any help.
Regards
Marzar00 |
|
Back to top |
|
 |
moose
Joined: 04 May 2003 Posts: 196 Location: Winnipeg Canada
|
Posted: Sun Oct 19, 2003 3:28 am Post subject: |
|
|
if you read the readme, you can find out that you can call the category ID number with a function, and then if you want you could put that function into an <img> tag so it would display an image like:
<img src="<?php function(); ?>" />
and replace function() with the real function |
|
Back to top |
|
 |
Viper007Bond
Joined: 15 Aug 2003 Posts: 266 Location: Portland, Oregon, USA
|
Posted: Sun Oct 19, 2003 5:26 am Post subject: |
|
|
A simpler way is to use the tag <?php the_category_ID() ?>, upload an image for each category into the same folder that your blog file is in and rename them to the name of the category you want it to show up (CASE SENSITIVE) for and then do this:
Code: | <img src="<?php the_category() ?>.gif" alt="<?php the_category() ?>" |
Example: It will show General.gif for posts from the category "General" and when you hover over the image, it will display the title of the category, "General".
I haven't tested it personally, but it should work. _________________ http://www.viper007bond.com
If you haven't already installed b2, I advise you look into WordPress or b2evo instead as b2 is dead.
Last edited by Viper007Bond on Sun Oct 19, 2003 5:45 am; edited 2 times in total |
|
Back to top |
|
 |
epolady
Joined: 30 Jul 2002 Posts: 800 Location: Texas
|
Posted: Sun Oct 19, 2003 5:37 am Post subject: |
|
|
That should work, I did something simliar but with the_author as an icon. Or if s/he wants something more organized s/he can use the_category and it would be named news.gif, sports.gif, rants.gif, etc. _________________ No more support from me. Goodbye!
Go upgrade to WordPress, you'll find better support there. |
|
Back to top |
|
 |
Viper007Bond
Joined: 15 Aug 2003 Posts: 266 Location: Portland, Oregon, USA
|
Posted: Sun Oct 19, 2003 5:43 am Post subject: |
|
|
Didn't think of that. Doh. Fixed.  _________________ http://www.viper007bond.com
If you haven't already installed b2, I advise you look into WordPress or b2evo instead as b2 is dead. |
|
Back to top |
|
 |
Marzar00
Joined: 19 Oct 2003 Posts: 7
|
Posted: Sun Oct 19, 2003 6:29 am Post subject: |
|
|
WOW That is so simple. Thanks for the help.
Regards
Marzar00 |
|
Back to top |
|
 |
Viper007Bond
Joined: 15 Aug 2003 Posts: 266 Location: Portland, Oregon, USA
|
Posted: Sun Oct 19, 2003 6:43 am Post subject: |
|
|
No problem.  _________________ http://www.viper007bond.com
If you haven't already installed b2, I advise you look into WordPress or b2evo instead as b2 is dead. |
|
Back to top |
|
 |
frauke
Joined: 31 Dec 2003 Posts: 4
|
Posted: Wed Dec 31, 2003 1:29 am Post subject: help |
|
|
Hi everyone, I hope someone can help me.
I have 2 different b2s installed on my server, one as my personal blog and one as sort of a reviews section. I used the aforementioned way to include category/resp. title icons to the posts and it's been working smoothly until a few days ago.
Now the images won't show up, but there are no red crosses or anything. When I hover over the place where the images should be the title pops up correctly...only there's no image.
Look here: http://www.meinetwegen.org/culture/
This is the code in the reviews blog
Code: | <img src="b2-img/<?php the_title() ?>.gif" alt="<?php the_title() ?>" style="border: 1px solid #F3F3F3; margin-right: 6px" align="left"> |
I don't know if that's important, but on the reviews blog I run the b2customfields hack (v.2).
So...the smallest hint at the solution would make me really really happy!
Thanks in advance
frauke |
|
Back to top |
|
 |
epolady
Joined: 30 Jul 2002 Posts: 800 Location: Texas
|
Posted: Wed Dec 31, 2003 1:34 am Post subject: Re: help |
|
|
Images on that site works fine for me. _________________ No more support from me. Goodbye!
Go upgrade to WordPress, you'll find better support there. |
|
Back to top |
|
 |
frauke
Joined: 31 Dec 2003 Posts: 4
|
Posted: Wed Dec 31, 2003 1:42 am Post subject: thx |
|
|
That was fast!
Are you serious? Well, then I should check my browser... have emptied temporary internet files and cookies several time, but it doesn't help. But anway, thanks! |
|
Back to top |
|
 |
epolady
Joined: 30 Jul 2002 Posts: 800 Location: Texas
|
Posted: Wed Dec 31, 2003 1:55 am Post subject: |
|
|
I looked at it in my internet explorer (was look at it in a different browser a sec ago).
I have no idea why it wouldn't show. If you right click where the image would go and save the image, it saves. my only guess is because you have spaces in your titles. _________________ No more support from me. Goodbye!
Go upgrade to WordPress, you'll find better support there. |
|
Back to top |
|
 |
frauke
Joined: 31 Dec 2003 Posts: 4
|
Posted: Wed Dec 31, 2003 2:26 am Post subject: |
|
|
There are indeed spaces... it's just strange, because it had already been working properly for more than a month.
How would this look in action?
Quote: |
[...]
<img src="<?php function(); ?>" />
and replace function() with the real function |
I'm not really familiar with functions... |
|
Back to top |
|
 |
epolady
Joined: 30 Jul 2002 Posts: 800 Location: Texas
|
Posted: Wed Dec 31, 2003 3:20 am Post subject: |
|
|
Were you with a different host or anything like for that month?
Well functions are things like the_title, the_author, the_time, so basically you're doing everything right, it could be the spaces. _________________ No more support from me. Goodbye!
Go upgrade to WordPress, you'll find better support there. |
|
Back to top |
|
 |
frauke
Joined: 31 Dec 2003 Posts: 4
|
Posted: Wed Dec 31, 2003 5:41 pm Post subject: |
|
|
epolady wrote: | Were you with a different host or anything like for that month? |
No, I wasn't, it was basically all the same.
I just tried to sort it out and the problem was the command (command? attribute? I don't know...) 'align="left"' in the image tag. I replaced it with 'float: left;' in the image style and again the same error occured. I fixed the problem by placing the content in a table, though I still have no idea why it wouldn't work.
Could it have anything to do with the Doctype?
Code: | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> |
Maybe not.
Nonetheless, thanks epolady for bothering in the first place!  |
|
Back to top |
|
 |
epolady
Joined: 30 Jul 2002 Posts: 800 Location: Texas
|
Posted: Thu Jan 01, 2004 5:20 pm Post subject: |
|
|
Did you fix it? I went to your site and the images appeared in IE. _________________ No more support from me. Goodbye!
Go upgrade to WordPress, you'll find better support there. |
|
Back to top |
|
 |
|