1 edb Feb 16, 2005 03:47
3 edb Mar 14, 2005 12:34
In the code block that follows where I say "Next add all the stuff that makes a post be a post, but not the stuff that adds comments and the comment form. After the above add:" you will want to compare THAT to the actual post loop for your skin. One thing I see is that you have "permalink, time, cats, words, flag" above your title on your sticky but not your ... ? ... loosies? Those things come from this part:
<div class="bSmallHead">
<a href="<?php $Item->permalink() ?>" title="<?php echo T_('Permanent link to full entry') ?>"><img src="img/icon_minipost.gif" alt="Permalink" width="12" height="9" class="middle" /></a>
<?php
$Item->issue_time();
echo ', ', T_('Categories'), ': ';
$Item->categories();
echo ', ';
$Item->wordcount();
echo ' ', T_('words'), ' ';
locale_flag( $Item->locale, 'h10px' );
?>
</div>
so delete that from the stickypost portion and that will be like your regular posts.
Your skin (looks like Guadeloupe?) has a title then a date and time and author over on the right, so you would have to look at your original post loop in _main.php and see where the title comes from, then duplicate the stuff for date/time/author in your stickypost loop.
It's not exactly *easy* but it's not hard either. For example the title comes from "<?php $Item->title(); ?>" so you look right after that for something that talks about date or date time and just copy paste. Don't forget to also copy your div or tag classes so you'll get the right look to everything.
4 foogoo Mar 14, 2005 12:54
Ah I missed that part, but just took care of it right now. I decided to leave the sticky a bit different looking than from the regular posts. And yes the skin is guadeloupe.
I also just started getting this error when I try logging out. I will poke around a bit if anyone has any other suggestions.
Warning: Cannot modify header information - headers already sent by (output started at /home/chs8425/public_html/blog/b2evocore/_class_blog.php:427) in /home/chs8425/public_html/blog/b2evocore/_functions_users.php on line 172
...(up to line 178)
Warning: Cannot modify header information - headers already sent by (output started at /home/chs8425/public_html/blog/b2evocore/_class_blog.php:427) in /home/chs8425/public_html/blog/htsrv/login.php on line 34
...(up to line 41 skipping a few)
5 edb Mar 14, 2005 13:29
Check for white space at the end of every file you've done any editing to. Even just opening something and saving it. White space being ANYTHING - extra lines, extra spaces - after the closing ?>. Some editors are really bad about throwing junk in there so you might want to check your files using good old notepad. Also it might not be the files the errors name - could be that those files are kicking out the errors induced somewhere else. Start by checking the files you know you opened in an editor and saved.
6 jibberjab Sep 23, 2005 05:32
This is a nice hack. I just got it running on a test blog. Just as an informative post, it seems to not pay attention to the fact that a post is labelled as private. The post still seems to show up, even if marked private. My test blog is .12.
jj.
7 edb Sep 23, 2005 05:50
Good catch. I didn't even think about stuff like that way back in the day... It's something we can do, but my brain is shot from chasing all the variations of blah.to through the antispam list. By the way it won't care about protected posts either - just that it can find a post ID that matches what you told it in your back office. I'll have to think about it again because it's another hack I did but don't use. My sorry excuse for a brain says "just put in a note that says post status doesn't matter" but that's not a cool answer. I'm thinking it should, as a minimum, care about protected posts. That way you could use your stickypost to sort of broadcast something to your bloggers but not the world. Private ones get a bit deeper to deal with. I think.
8 jibberjab Nov 19, 2005 22:49
Anyone tried this with "Dawn"? Does it still work?
jj.
9 edb Nov 19, 2005 22:58
I haven't tried it yet, but I should. I should get myself a 'clean' .9.1 installation and add this hack to test it. As to the 'private' issue: I don't think I gave that any thought at all. I figured the user would want a stickypost to say something to the world, so I sort of assumed it would be a public post.
If I find the time to test this on dawn before phoenix comes out I'll see about making sure that private posts are kept private. It'll be hard though because the way I did this was to say "to heck with everything b2evo does about putting posts out there on the web - just show me post #N first".
NO PROMISES!!! I've made too many promises here that I can't deliver on, so I've learned to say "no promises". I also add the thread to my list of watched topics so I can come back to it when I have time to spare.
10 jibberjab Nov 19, 2005 23:26
Oh, not a problem at all about the 'private' thing.. The only reason I even mentioned it in that earlier post was because I had installed the hack, and was testing it on a private post to make sure it worked properly before publishing the post. I was logged in with firefox. When I checked it with IE I had noticed that it also appeared there, though I wasn't logged in. So, again, that's the only reason I even brought it up. As you said, a stickyposted post would 99.999% of the time be meant for public display anyway, so to me it's a non-issue.
jj.
11 jibberjab Nov 23, 2005 06:14
Here's another one... (I'm not picking on you EdB, I swear it!). Stickypost acts pretty funky when a post is crossposted across blogs. The bSmallHead and bSmallPrint sections show up, but the body of the post does not.
I thought that with all the direct database meddling I did in the last 48 hours something got seriously screwed up, but I tried a different post from the same blog, which wasn't crossposted, and it worked just fine.
Only reason I bring it up is because others might be crossposting on their blogs and might run into the same thing.
jj.
12 tacampbell Jan 16, 2006 23:19
My approach requires a little more hands in the works to make updates, but it required no hacks.
1) Create the post you want to make sticky.
2) Go into phpmyadmin on your server and add a field "post_sticky" to the posts table (may have a prefix depending on how your server is set up). I created it as tinyint, with default 0.
3) Browse the posts table to find the post you want to be sticky and edit it. Put a "1" in the "post_sticky" field.
4) Edit your /conf/_config.php file and add a line:
$orderby = 'sticky issue_date';
Any time I want to change or even add to the list of sticky posts, I just use the phpmyadmin tool to add a 1 in the sticky field for the post. It's not a pretty interface, but I don't have to worry about tracking down hacks in standard files as patches come out - just backup my config.php file.
It works because the default sort order is DESC by issue_date (see _class_itemlist.php) . You can set many other fields from class_itemlist.php, (like if you want to order by title instead of date) just by declaring them in your config.php file.
Tom Campbell
http://blog.tacampbell.net
13 yabba Jan 17, 2006 00:56
You could of course use a seperate blog for your sticky posts and then you can reduce it to a simple skintag ;)
¥
14 balupton Jan 17, 2006 20:48
Yer i think ¥åßßå's or tacampbell's way of doing it seems more logical and effecient...
15 balupton Jan 17, 2006 20:58
links are bad
Edit: Wrong topic....
16 juzzwuzzz Jan 20, 2006 15:03
tacampbell wrote:
My approach requires a little more hands in the works to make updates, but it required no hacks.
1) Create the post you want to make sticky.
2) Go into phpmyadmin on your server and add a field "post_sticky" to the posts table (may have a prefix depending on how your server is set up). I created it as tinyint, with default 0.
3) Browse the posts table to find the post you want to be sticky and edit it. Put a "1" in the "post_sticky" field.
4) Edit your /conf/_config.php file and add a line:
$orderby = 'sticky issue_date';Any time I want to change or even add to the list of sticky posts, I just use the phpmyadmin tool to add a 1 in the sticky field for the post. It's not a pretty interface, but I don't have to worry about tracking down hacks in standard files as patches come out - just backup my config.php file.
It works because the default sort order is DESC by issue_date (see _class_itemlist.php) . You can set many other fields from class_itemlist.php, (like if you want to order by title instead of date) just by declaring them in your config.php file.
Tom Campbell
http://blog.tacampbell.net
It looks great to have that to on my website. I did the 4 steps but I get an error when I have done that.
The error I get is:
MySQL error!
Unknown column 'post_issue_date' in 'order clause'(Errno=1054)
Your query: Get ID list for Item List (Main|Lastpostdate) Query
SELECT DISTINCT post_ID
FROM evo_posts INNER JOIN evo_postcats ON post_ID = postcat_post_ID
INNER JOIN evo_categories ON postcat_cat_ID = cat_ID
WHERE (cat_blog_ID = 2)
AND ( ( post_status IN ('published') ) )
AND (post_datestart <= '2006-01-20 08:56:48')
ORDER BY post_sticky DESC, post_issue_date DESC
LIMIT 5
Backtrace:
1. db->print_error( "", "Get ID list for Item List (Main|Lastpostdate) Query" )
File: /var/www/virtual/jdefluiter.byethost11.com/htdocs/blogs/evocore/_db.class.php:557
2. db->query( "SELECT DISTINCT post_ID FROM T_posts INNER JOIN T_po...", "Get ID list for Item List (Main|Lastpostdate) Query" )
File: /var/www/virtual/jdefluiter.byethost11.com/htdocs/blogs/evocore/_db.class.php:759
3. db->get_col( "SELECT DISTINCT post_ID FROM T_posts INNER JOIN T_po...", 0, "Get ID list for Item List (Main|Lastpostdate) Query" )
File: /var/www/virtual/jdefluiter.byethost11.com/htdocs/blogs/evocore/_db.class.php:782
4. db->get_list( "SELECT DISTINCT post_ID FROM T_posts INNER JOIN T_po...", 0, "Get ID list for Item List (Main|Lastpostdate) Query" )
File: /var/www/virtual/jdefluiter.byethost11.com/htdocs/blogs/evocore/_itemlist.class.php:403
5. itemlist->itemlist( 2, Array(0), NULL, NULL, -1, NULL, Array(0), NULL, "DESC", "sticky issue_date", 0, NULL, NULL, NULL, "", "AND", NULL, 0, "", "", "now", "", NULL )
File: /var/www/virtual/jdefluiter.byethost11.com/htdocs/blogs/evocore/_blog_main.inc.php:292
6. require( "/var/www/virtual/jdefluiter.byethost11.com/htdocs/blogs/evocore/..." )
File: /var/www/virtual/jdefluiter.byethost11.com/htdocs/blogs/justinweblog_stub.php:58
Ignored last: 1
Hope someone can help. I have set the settings back to normal. So you can't see the error on my site. I think the problem is with the settings of the order by. (btw I have te latest versoin of B2evo quess it is 1.6 or something)
Thanks
17 juzzwuzzz Jan 23, 2006 10:48
Nobody knows what I'm doing Wrong???
18 yabba Jan 23, 2006 11:22
change issue_date to datecreated ;)
¥
EdB -
I specially registered just so I can post a reply to say thanks! Your post was incredibly helpful, especially for someone like me who just recently installed B2 and know pretty much nothing about php. It's an awesome hack!
Now I noticed that the sticky has Permalink buttons the regular posts don't have. Is there a way I can remove the Permalinks so the sticky resembles a regular post?
My blog is at http://www.chingster.com/blog if you guys are curious. It is very much still under construction as you can tell! B)