2 balupton Jul 28, 2007 01:33

This plugin works precisely as advertised, and is very cool.
One byproduct I've discovered is that the the "sticky" message not only becomes the first item on the given blog, but the first item in the RSS feed, until the post is no longer sticky. I have some Feedburner Buzzboosts set up, and discovered the first message in them was the "sticky." Is there any way to have the sticky be at the top of the blog but not affect the web feed?
Example here:
Hrmmm, Odd, I will look into it and make it a setting.
Is it correct this plugin doesn't work in 2.0a?
I haven't even touched b2evo v2 so I would have no idea. I only plan to touch it when a official release comes out, and even then, I may not decide to support it until it gets badged stable.
That's fine with me, it was my choice to put 2.0 on. But then I can make it a statement: The [Plugin] Sticky Announcements Version 1.2.0.0-final doesn't function in B2evo 2.0.
b2evo v 1.10.2
I'm not sure how to use this. I installed it OK - I noticed that a new blog got created called "announce". I posted into that and now it's gone into all the blogs. Great if that's what I wanted but I don't. I can't see a way to just post a sticky post into one Blog only
sorry - that was a really dumb question - I have figured it out now
great plugin
I used v2.4 rc2, so I wanna use sticky announcement, can I? If can, pls show me how to use it because I already install the plugin but I dont know how to make it happen.
I dunno if it will work for your version (I'm using 1.10.2) but maybe you missed the same thing as I did. When you write a blog post under "Title" you will see "post type" and a drop down menu. Where it used to say "post" or "link" you should now have a third option "sticky". Also you should have a new blof created called "ANNOUNCEMENTS". Writing to this will post a sticky in ALL the other bl;ogs
TQ! Stevet! It seems like I cant use it on v2.4.0, there's no third option called 'sticky' or new blog call 'announcements'.
But one more thing, I'm from Malaysia, so how I want to change my blog/post time to Malaysian time GMt+8
and should I turn to v1.10.3? because there's a lot of problems using v2.4.0. I even cant set my 3rd blog as default display.
Any suggestion?
I have no experience of V2 and may not have for quite some time. It seems to me that much that is good is lost and there is a lot to learn (or unlearn)
hopefully some one else will have the answer for you
I installed this years ago and can only say that it still allows me to make a Sticky post in 2.4 !!!! and I think I've even deleted it :)
The stickyannouncements plugin does little. It sets up a blog, somewhat hidden, where you can create announcements that will be distributed to your other blogs simply by sharing a category from the Announcement blog.
The sticky thing is done by a new post type. In your stub or index.php you can then sort the posts by posttypeID. This basically sorts the sticky on top, leaving every other post as is. This is a very easy (manual) adjustment that is described here: [url=http://forums.b2evolution.net/viewtopic.php?t=14080]"The same opening page whenever people go to my blog"[/url].
So again: the plugin will only do the installation and preparation for you. You can do this yourself in a 2.x setup.
Good luck
Yeah, this one definitely confuses the heck out of me.
I just upgraded one of my installs to 2.4, and I wanted to make an entry about the upgrade and changes 'Sticky.' However, when I create a Type:Sticky entry it doesn't 'stick' to the top of the page.
Looking around the Dashboard I don't see where in the settings it allows me to "sort the posts by posttypeID" as Afwas suggests.
So, I'm stuck. Anyone?
¥åßßå wrote:
1) create a new post type "on top" or whatever
2) use a stub file
3) change/add the following to the stub file
$orderby = 'ptyp_ID datemodified';
4) make your intro post and set its post type to whatever you called your new type
¥
¥åßßå suggests using stubs here, but you can do the sorting in index.php as well.
Good luck
Just so I'm clear -- I would edit this line in index.php:
# Additionnaly, you can set other values (see URL params in the manual)...
# $order = 'ASC'; // This for example would display the blog in chronological order...
This line would be uncommented and changed from $order = 'ASC' to $orderby = 'ptyp_ID datemodified'; ? Do I understand correctly?
Yes
Well, that didn't do what I hoped.
My 'Sticky' item was second in the list. First was a 'Post' which was created after my Sticky was modified from 'Post' to 'Sticky'.
Is there a way to tell b2 to put Sticky above Posts, regardless of date? I see in Global Settings >> Post types that Sticky (3) is below Link (2) and Post (1). Can this order be changed, and am I correct in thinking that this would affect 'ptyp_ID' ? Is it simply a matter of editing this page and changing the name?
Sticky should be post type #5001. That's even higher than the Reserved ones.
If you sort them DSC on post type the stickies will come on top automatically.
Good luck
What I see on my 'Global Settings >> Post types' is this:
Item/Post/Page types
ID Name
2 Link
1000 Page
2000 Podcast
1 Post
3000 Reserved
4000 Reserved
5000 Reserved
3 Sticky
ok,
Put in your index.php:
$order= 'DSC';
$orderby = 'ptyp_ID datemodified';
and the stickies show before the posts.
Good luck
Alas, I still see a 'Post' above a 'Sticky'
And you might want to fix that typo for DSC to $order= 'DESC';
I'll fire up the testblog and come back to this topic later
Hi BaileyWTNH,
You are right. This doesn't work as advertised.
I found some traces of work in progress in the code. May be this possibility is (deliberate or not) disabled at the time.
I will see if I can get some more information.
Perhaps ¥åßßå knows what's going on.
--Afwas
as long as you have the $orderby ( you don't need the $order="DESC" ... it's assumed by the core as default ), above the two includes at the end of the file then everything should work as planned.
If not then enable debug mode ( conf/........urm .... _advanced.php or summat ) and see what query is actually being run for building the mainlist.
¥
Query #16: ItemList2::Query() Step 1: Get ID list
SELECT DISTINCT post_ID
FROM evo_items__item INNER JOIN evo_postcats ON post_ID = postcat_post_ID INNER JOIN evo_categories ON postcat_cat_ID = cat_ID
WHERE (cat_blog_ID = 9)
AND (( post_ptyp_ID IS NULL
OR post_ptyp_ID NOT IN (1000) ))
AND (post_datestart <= '2008-02-27 19:49:57')
AND ( ( ( post_status = 'private'
AND post_creator_user_ID = 1 )
OR post_status IN ('published','protected') ) )
ORDER BY post_datestart DESC, post_ID DESC
LIMIT 5
The interesting part being:
ORDER BY post_datestart DESC, post_ID DESC
and
CollectionSettings::get( 9/posts_per_page/ ): '5'
CollectionSettings::get( 9/orderby/ ): 'datestart'
CollectionSettings::get( 9/orderdir/ ): 'DESC'
Wow -- that's a lot of debug information. Anyway, here's what mine says:
Query #16: ItemList2::Query() Step 1: Get ID list
SELECT DISTINCT post_ID
FROM evo_items__item INNER JOIN evo_postcats ON post_ID = postcat_post_ID INNER JOIN evo_categories ON postcat_cat_ID = cat_ID
WHERE (cat_blog_ID IN (2,3,5,6,7,8,9,10,11,13,15))
AND (( post_ptyp_ID IS NULL
OR post_ptyp_ID NOT IN (1000) ))
AND (post_datestart <= '2008-02-27 14:10:50')
AND ( ( ( post_status = 'private'
AND post_creator_user_ID = 1 )
OR post_status IN ('published','protected') ) )
ORDER BY post_ptyp_ID DESC, post_datemodified DESC, post_ID DESC
LIMIT 8
The sticky post now works in the testlab. I wonder where I uploaded the index.php to?
Here is the current DB query that leaves me puzzled as to why this doesn't work for BaileyWTNH.
Query #16: ItemList2::Query() Step 1: Get ID list
SELECT DISTINCT post_ID
FROM evo_items__item INNER JOIN evo_postcats ON post_ID = postcat_post_ID INNER JOIN evo_categories ON postcat_cat_ID = cat_ID
WHERE (cat_blog_ID = 9)
AND (( post_ptyp_ID IS NULL
OR post_ptyp_ID NOT IN (1000) ))
AND (post_datestart <= '2008-02-27 20:24:57')
AND ( ( ( post_status = 'private'
AND post_creator_user_ID = 1 )
OR post_status IN ('published','protected') ) )
ORDER BY post_ptyp_ID DESC, post_datemodified DESC, post_ID DESC
LIMIT 5
Afwas, when the Sticky post is in single post mode it's generating the following error at the top of your page...
WARNING: unhandled sorting: ptyp_IDWARNING: unhandled sorting: ptyp_ID
Thanks John,
There is an even more curious error in the single post mode.
The link at the arrow shouldn't exist, it links to itself!
Yeah, I got that too.
http://wtnh.tv/blogs/media/20080227-b2error.gif
Mine's on a modified Evopress skin.
hmmm, looks like you just found a core bug :P
You can probably get around it by changing the $orderby to something like this :
if( empty($_GET['disp'] ) )
{
$orderby = 'ptyp_ID datemodified';
}
¥
So by finding a core bug, do I get a B2 t-shirt or lunch with Francois if I ever make a trip back to Paris? B)
I'll try your workaround later in the day.
As I don't use a long description in a Sidebar ( I don't have a Sidebar) I just use this
<?php $Blog->disp( 'longdesc', 'htmlbody' ); // the long description of your blog ?>
to display a sticky.
With an appropriate container, you could just use the widget to display this as well.
Pro's: Easy to edit/change the content via the text area in Blog Settings -> General.
Cons: It is just a static block of content.
I have solved the bug we encountered. It's only a single line of code you want to add. See [url=http://forums.b2evolution.net/viewtopic.php?t=15184][2.4.1] Not a bug when sorting posts and viewing single post[/url]
Good luck
I get the following message on install:
Fatal error: Call to a member function get_by_name() on a non-object in /var/www/comedy/plugins/stickyannouncements_plugin/_stickyannouncements.plugin.php on line 144
I'm running version 2.4.5
Will this work with 2.4.5? Thanks.
Do not use the plugin. That one is for 1.10.x
For sticky posts you can do the (easy) hack
1) create new a Post type in Dashboard -> Global options -> Post types. Your new Post type will have a huge number (5001 most likely)
2) Crack open /blogs/index.php and add this as 'one but last line':
$orderby = 'ptyp_ID datemodified';
the last line will be:
// That's it, now let b2evolution do the rest! :)
require $inc_path.'_blog_main.inc.php';
When you write a post you now have the new Post type. If you select it, the post will float on top of other posts. In 2.4.5 there's no need to do the other hack.
Good luck
Afwas wrote:
Do not use the plugin. That one is for 1.10.x
For sticky posts you can do the (easy) hack1) create new a Post type in Dashboard -> Global options -> Post types. Your new Post type will have a huge number (5001 most likely)
2) Crack open /blogs/index.php and add this as 'one but last line':
$orderby = 'ptyp_ID datemodified';
the last line will be:
// That's it, now let b2evolution do the rest! :) require $inc_path.'_blog_main.inc.php';
When you write a post you now have the new Post type. If you select it, the post will float on top of other posts. In 2.4.5 there's no need to do the other hack.
Good luck
THanks for the quick response! I'll try that out!
hmm, just noticed today that Im getting a warning message when you look at a single post.
the warning message is: WARNING: unhandled sorting: ptyp_IDWARNING: unhandled sorting: ptyp_ID
It works fine on the main page, so Im only getting this when you look at a single post.
Hi boneill,
Either you upgrade to B2evolution 2.4.5 or you apply the fix yourself see [url=http://forums.b2evolution.net/viewtopic.php?t=15184][2.4.1] Not a bug when sorting posts and viewing single post[/url].
Good luck
Got it! Thanks! I guess I should have looked up a couple posts first.. :oops:
No problem. I knew the answer to the question :p
Can anyone tell me, how to make it work????
I have installed it, but NOTHING happened.
b2evolution 2.4.2
I really didn't expect this to work "Sticky Announcements Plugin"
I wish I had the time to spend to learn how to code things, I really hate being dependent on others. Plus I could have my name on some cool useful stuff.
What We are trying to do is figure out the best way to use B2 as a store. Well kind of right now we are looking to try and get the store look for affiliate stuff.
In the future something like an osCommerce type deal, WordPress has a skin for this just trying to be loyal here.
For now I'm thinking just a sticky on top and blog posts under it for content.
That was the long way around, Gan anyone help me out and check out the Sticky Announcements Plugin to see if it's worth fixing?
Thanks for your time in advance!
Brad West ~ onomoney
Afwas wrote:
Do not use the plugin. That one is for 1.10.x
For sticky posts you can do the (easy) hack1) create new a Post type in Dashboard -> Global options -> Post types. Your new Post type will have a huge number (5001 most likely)
2) Crack open /blogs/index.php and add this as 'one but last line':
$orderby = 'ptyp_ID datemodified';
the last line will be:
// That's it, now let b2evolution do the rest! :) require $inc_path.'_blog_main.inc.php';
When you write a post you now have the new Post type. If you select it, the post will float on top of other posts. In 2.4.5 there's no need to do the other hack.
Good luck
I did this in 3.3.2 and it basically just sorted my posts by last edited, which is totally not what I want since I edit old posts all the time (Guide site). Is there someway to still make a sticky post?
Hi Jackets
No hacks required in 3.3.2 as there are intro posts. Take a look at the manual:
http://manual.b2evolution.net/Intro_and_featured_posts
L
lturner wrote:
Hi Jackets
No hacks required in 3.3.2 as there are intro posts. Take a look at the manual:
http://manual.b2evolution.net/Intro_and_featured_posts
L
Ah! Very awesome, thanks. Learn a new feature every day. =D
Finally Released.