1 gpaveau Mar 17, 2004 11:48
3 isaac Apr 24, 2004 02:03
Is there some reason why you can't use the blog description or blogroll for this purpose? It seems like you're making it harder than it has to be. Maybe I'm just missing something.
Isaac
4 gpaveau Apr 24, 2004 10:24
I should try maybe you're right Isaac, I made things too copplicated maybe ;)
I guess the blogroll could be good, and it's maybe what i sort of recreated
The description is a good idea I'll look in this direction too
thanks
5 edb May 11, 2004 22:16
I finally did this using the long description field and it works rather easily.
<div class="bPosts">
<div class="LongDesc">
<p><?php bloginfo('longdesc', 'htmlbody'); ?></p>
</div>
<?php // --- START OF POSTS ---
That shows where to put the div so it only shows up once, which is probably a no-brainer but I made a couple of guesses at it before it worked. You could use "bPost" and "bText" if you want, but I wanted it displayed with the page background color and no border so I made up the "LongDesc" class. I also have a random image that I float:left, hence the P tag.
It's at http://whitesandshanggliding.com/main.php for those interested in seeing it.
This way when the search engines cache the main page from each blog they get stable text at the top of the page in addition to the changing post content.
6 isaac May 11, 2004 23:26
Yeah, EdB, you made me realize something.
The question isn't so much "How do you get a post to stay at the top?" as it is "How do you make the description look like a post?"
That shouldn't require any crazy hacks. Just a matter of setting up the skin/template to use the same XHTML and CSS for the description as it does for the posts. (Note: in different skins, the classes might not be "bPost", and the specific XHTML might be different, etc. The point is that it's done up like a post would be.) I do something like this on [url=http://isaac.beigetower.org/index.php?skin=autumn]my site[/url]. It's really just a stylistic question.
7 gpaveau May 12, 2004 09:17
Thanks EdB !!!! :D
It's exactly what i was looking for, for a static description it's perfect, my only question now ;-) is how can we include a dynamic code into the description, but maybe I'm asking too much (the longdesc was maybe not aimed for that ?)
like the list of article on the top of the articles on this page :
http://www.uisce.net/irl.php
Thanks again
8 graham May 12, 2004 11:47
You mean include a php tag in there? If you do, then no, as far as I'm aware, it's pulled as plain text which is then parsed by the browser, not the server. If you mean dhtml or something, then I don't see any reason why you can't...
9 edb May 12, 2004 19:32
Graham is probably right about putting actual php content into the long description BUT you can put html in there. Browsers like html! I just added a link to the long description on a hidden blog and found that it works like you would expect. In other words: "<? php some_thing(param) ?>" will (probably) not work but "<a href="yourlink.php" title="whatever">Text<a/>" will work. That implies you can do all your div stuff and whatever else you like in the long description field and have it properly executed by the browser, but I'm only guessing - experimentation will hook you up on it.
Code is cool B)
10 isaac May 12, 2004 19:39
Ah, now we're talking hacks.
Anyone know what we'd have to do to make a hack that would allow one to put PHP in the long description or blogroll fields?
I'm thinking you might be able to hack the functions that display the blogroll/longdesc to look for a specific tag, and then include a php file from somewhere. So you'd have something like this in your blogroll or longdesc field:
<!--phpinclude=somethingfunky.php-->
and then you could put all the code in the somethingfunky.php file.
When displaying these items, you could have the function split up the string based on the <!--phpinclude=...-->, and include whatever file is specified in the tag. Then you could easily replace the static blogroll with a tagboard, for example, without changing the skins at all.
The other option, to have PHP code directly inserted into the field, would be a little more complicated, since the functions just drop the data directly without parsing it. I think that you'd have to have a function that writes the data to a file, and then includes it, and that might be more tricky. For starters, you wouldn't want to have to write the include file every time, since that'd probably be pretty server-heavy. (PHP would have to read-parse-write-read-parse-output each time, instead of just read-parse-output.) Maybe it could dump the contents of the blogroll to a file when you change and save it, and then just save the name of that file to the database? Seems like that'd be getting more and more complicated...
Putting PHP in the static fields would be super-cool, IMO.
11 mustache May 19, 2004 20:57
Has the topic of creating 'sticky' posts come up yet?
I think that fits more (and has more uses). Basically, it just a modification of the SQL querry to add a field in another orderby column. This way you can have post that introduces main categories, for instance.
12 isaac May 19, 2004 22:18
[url=http://b2evolution.net/dev/todo.php/2004/05/16/p2673]Sticky Posts[/url] and [url=http://b2evolution.net/dev/todo.php/2004/04/13/p2217]extended categories[/url] are both on the [url=http://b2evolution.net/dev/todo.php]ToDo list[/url].
As I understand it:
Sticky post = a post that always shows up at the top, regardless of the date that it was posted.
Extended categories = ability to add an icon and description for each category. This could be used to show the "post that introduces main categories, for instance." - in the template or skin, you'd have a function to call the category description, but only if a single category is selected. (Somewhat like how single_cat_title() works now. Not sure if this fxn is deprecated or not, I'm still working on getting up to speed with all the changes.)
13 mustache May 19, 2004 22:38
Ah, I see. :D
14 liphtier Apr 26, 2006 22:13
Hello !
I see it was long time ago
Is there any progress on "Extended Category" ?
I made some sort of hack for this (see my post at http://forums.b2evolution.net/viewtopic.php?t=852 )
but it would be better if I had not had to alter files in evocore I think. I'm not so familiar with complex OO structures (And paranoid about what security holes I can leave :) )
Now I'm going to "hack" for "extended category" feature at my site, but may be I missed it somewhere and I don't have to invent the bycicle ?
Thank you!
15 john Apr 27, 2006 15:31
Adding EdS's snippet to one someone posted that just lets it appear on the Home page works well. You can also easily style it to look like a normal post using the ID's and Classes from your current CSS.
EG:
<div class="bText">
<?php
if( !$s && !$cat && empty($catsel) && !$m && $disp=='posts' && !$title && !$p )
{
?>
<p><?php bloginfo('longdesc', 'htmlbody'); ?></p>
<?php
}
?>
</div>
hi,
i haven't had the time to try the hack although that might do what i have been waiting to be done. just want to point out that your 2nd url is wrong, i believe it should read: http://www.uisce.net/irl.php.
cheers!
-ashrobo