Great - that's good to know. Got livesearch up and running, and I'll work through the other exts that I'd like to see on the blog page. Thanks - particularly for the speedy reply.
If you've got any further thoughts on why my nugget's not working, I'm all ears... ;)
So Latest blog post is visible in other pages but not on blog page. Does it give any errors.one more thing do you have any blog posts. IS the heading "latest Blog Post" showing or not Look in Nuggets.php and see if Blog is listed under pages of "latest blog extension" it should look like this<?php return array(0 => array('name' => 'Latest Blog Post', 'id' => 1, 'description' => '', 'position' => 'PANEL', 'status' => 1, 'hideName' => 0, 'html' => '<?php global $Context; $DiscussionManager = $Context->ObjectFactory->NewContextObject($Context, "DiscussionManager"); AddLatestBlogPostToPanel($Context, $Panel, $DiscussionManager); function AddLatestBlogPostToPanel (&$Context, &$Panel, &$DiscussionManager) { global $Panel; $LatestBlogPostList = ""; $Discussion = $Context->ObjectFactory->NewContextObject($Context, "Discussion"); $LatestBlogPost = $DiscussionManager->GetDiscussionList(5, 1, $Context->Configuration["BLOG_CATEGORY_ID"]); while ($Row = $DiscussionManager->Context->Database->GetRow($LatestBlogPost)) { $Discussion->Clear(); $Discussion->GetPropertiesFromDataSet($Row, $Context->Configuration); $Discussion->FormatPropertiesForDisplay(); $LatestBlogPostList .= \'<li><a href="\'.GetUrl($Context->Configuration, "comments.php", "", "DiscussionID", $Discussion->DiscussionID, "", "#Item_1", CleanupString($Discussion->Name)."/").\'">\'.$Discussion->Name.\'</a></li>\'; } $LatestBlogPostList .= \'<li style="margin-top:10px;"><a href="\'.GetUrl($Context->Configuration, "extension.php", "category/", "CategoryID", $Context->Configuration["BLOG_CATEGORY_ID"], "", "PostBackAction=Blog").\'">Show all</a></li>\'; echo $LatestBlogPostList; }?>', 'weight' => -8, 'roles' => array(0 => 0, 1 => 2, 2 => 3, 3 => 4), 'pages' => array(0 => 'comments.php', 1 => 'index.php', 2 => 'Blog', 3 => 'extension.php')), Notice how Blog is listed under pages array
That fixed it. Had a quick look in Page management and noticed that the tab identifier for my blog page is "blog", although the title is "Blog". I don't remember entering that myself (Page manager instructions say leave the identifier alone) - but I'm guessing that's where the lowercase came from...
Now it works just fine :) Thanks again for this great extension.
However, I have a question: what should I change in order to get the draft box checked by default? This would prevent to publish stuff by accident for first time users. I guess it has something to do with lines 32-34 in Function.Blog.php, am I wrong? I'm not sure what to change. echo '<li class="Draft"> <label>'.GetBasicCheckBox("Draft", 1, $Draft, '').' '.$Context->GetDefinition('Draft').'</label> </li> ';
MySchizoBuddy had said: @strawberries Example site by mis-one
Thanks MySchizoBuddy for the url. Sorry for taking a few days to reply.
The blog is looking good. Keep up the sterling work.
This extension is great! Thank you very much, Schizo.
However, I got an error, similar to the problem sujang mentioned. When not signed in and browsing the blog, after clicking the sign-in link I receive an error: Notice: Undefined index: CssClass in /***/html/themes/people_banner.php on line 5
I would also love to see delegates used to prevent non-admin to write blog entries. Is it possible to use the more tag with the ForcedBBCode extension only?
Deleted discussions are still shown at the blog start page. Edit: First comment of blog discussion can't handle attachments. They are uploaded but not shown.
Jumping on Tex's first point - is there no way to prevent non-admins from posting? I can clear create/draft/etc privileges from the permissions for certain roles, but my users can still start a new discussion and simply put the new discussion in the blog category... Forgive me if I'm missing something obvious - it's late (in this part of the world) - should have been sleeping hours ago...
As with Tex: When not signed in and viewing blog, clicking the sign in button results in an error.
Notice: Undefined index: CssClass in .../home/themes/people_banner.php on line 5
I have a problem with the Latest Discussions Prime extensions. I know this not a bug, and I'm not sure if it's this extension or yours which requires a little hack, but here's the problem. Draft posts are shown in the latest discussions list. Would there be a way to hide them (or even hide the whole blog category)?
Me again, sorry. Latest Blog Posts are shown everywhere I defined them to do. Only at the discussions page they are not. Did I make a mistake anywhere (I'm sure I did miss something)?
Yep, I know there's an option for hiding blog posts in the discussion list, but in fact I was speaking about the Latest Discussions Prime list. I'd just like to know if there's a way to hide draft posts in this list, not in the main discussions list. Or maybe should I drop this extension and use Nuggets with a specific code instead?
Seems when I add a comment to a blog post, the comment replaces the original post on the main blog page (and the original post "sinks"). Is this by design? I'd like to have the main post on the main page and replies on the "reply" page!
I looked at the Blog add-on and it adds a field Draft to the Discussion table. Since it defaults to '0', I assume that means not a draft. So, you need to add an additional WHERE to the select in the LatestDiscussionPrime add-on, probably after the line: $s->AddWhere('cm', 'AuthUserID', '', $D->Context->Session->User->UserID, '='); ==> $s->AddWhere('t', 'Draft', '', '0', '=');
Thanks a lot, it works just fine. The only "problem" is that when you edit the blog post in order to remove the draft status, it's marked as new by Latest Discussions Prime for the autor of the post, but this is definitely not a real problem.
Oops, I spoke too fast - in fact, looks like the draft is hidden only for his autor. I logged in as another user and tried as a guest, I still see it in both cases.
Edit: Ok, I added what you suggested also after line 48, like this : $s->AddOrderBy('DateCreated', 't', 'desc'); $s->AddWhere('t', 'Draft', '', '0', '='); ...and now it seems fine :)
Comments
If you've got any further thoughts on why my nugget's not working, I'm all ears... ;)
- Spam
- Abuse
0 · Insightful Awesome LOL ·<?php return array(0 => array('name' => 'Latest Blog Post', 'id' => 1, 'description' => '', 'position' => 'PANEL', 'status' => 1, 'hideName' => 0, 'html' => '<?php global $Context;Notice how Blog is listed under pages array$DiscussionManager = $Context->ObjectFactory->NewContextObject($Context, "DiscussionManager");
AddLatestBlogPostToPanel($Context, $Panel, $DiscussionManager);
function AddLatestBlogPostToPanel (&$Context, &$Panel, &$DiscussionManager) {
global $Panel;
$LatestBlogPostList = "";
$Discussion = $Context->ObjectFactory->NewContextObject($Context, "Discussion");
$LatestBlogPost = $DiscussionManager->GetDiscussionList(5, 1, $Context->Configuration["BLOG_CATEGORY_ID"]);
while ($Row = $DiscussionManager->Context->Database->GetRow($LatestBlogPost)) {
$Discussion->Clear();
$Discussion->GetPropertiesFromDataSet($Row, $Context->Configuration);
$Discussion->FormatPropertiesForDisplay();
$LatestBlogPostList .= \'<li><a href="\'.GetUrl($Context->Configuration, "comments.php", "", "DiscussionID", $Discussion->DiscussionID, "", "#Item_1", CleanupString($Discussion->Name)."/").\'">\'.$Discussion->Name.\'</a></li>\';
}
$LatestBlogPostList .= \'<li style="margin-top:10px;"><a href="\'.GetUrl($Context->Configuration, "extension.php", "category/", "CategoryID", $Context->Configuration["BLOG_CATEGORY_ID"], "", "PostBackAction=Blog").\'">Show all</a></li>\';
echo $LatestBlogPostList;
}?>', 'weight' => -8, 'roles' => array(0 => 0, 1 => 2, 2 => 3, 3 => 4), 'pages' => array(0 => 'comments.php', 1 => 'index.php', 2 => 'Blog', 3 => 'extension.php')),
- Spam
- Abuse
0 · Insightful Awesome LOL ·- Spam
- Abuse
0 · Insightful Awesome LOL ·<?php return array(0 => array('name' => 'Latest Blog post', 'id' => 1, 'description' => '', 'position' => 'PANEL', 'status' => 1, 'hideName' => 0, 'html' => '<?php global $Context;
$DiscussionManager = $Context->ObjectFactory->NewContextObject($Context, "DiscussionManager");
AddLatestBlogPostToPanel($Context, $Panel, $DiscussionManager);
function AddLatestBlogPostToPanel (&$Context, &$Panel, &$DiscussionManager) {
global $Panel;
$LatestBlogPostList = "";
$Discussion = $Context->ObjectFactory->NewContextObject($Context, "Discussion");
$LatestBlogPost = $DiscussionManager->GetDiscussionList(5, 1, $Context->Configuration["BLOG_CATEGORY_ID"]);
while ($Row = $DiscussionManager->Context->Database->GetRow($LatestBlogPost)) {
$Discussion->Clear();
$Discussion->GetPropertiesFromDataSet($Row, $Context->Configuration);
$Discussion->FormatPropertiesForDisplay();
$LatestBlogPostList .= \'<li><a href="\'.GetUrl($Context->Configuration, "comments.php", "", "DiscussionID", $Discussion->DiscussionID, "", "#Item_1", CleanupString($Discussion->Name)."/").\'">\'.$Discussion->Name.\'</a></li>\';
}
$LatestBlogPostList .= \'<li><a href="\'.GetUrl($Context->Configuration, "extension.php", "category/", "CategoryID", $Context->Configuration["BLOG_CATEGORY_ID"], "", "PostBackAction=Blog").\'">Show all</a></li>\';
echo $LatestBlogPostList;
}?>', 'weight' => 1, 'roles' => array(0 => 0, 1 => 2, 2 => 5, 3 => 3, 4 => 6, 5 => 4), 'pages' => array(0 => 'blog', 1 => 'extension.php'))); ?>
- Spam
- Abuse
0 · Insightful Awesome LOL ·- Spam
- Abuse
0 · Insightful Awesome LOL ·Thanks again for your help. It's appreciated.
- Spam
- Abuse
0 · Insightful Awesome LOL ·- Spam
- Abuse
0 · Insightful Awesome LOL ·However, I have a question: what should I change in order to get the draft box checked by default? This would prevent to publish stuff by accident for first time users.
I guess it has something to do with lines 32-34 in Function.Blog.php, am I wrong? I'm not sure what to change.
echo '<li class="Draft"><label>'.GetBasicCheckBox("Draft", 1, $Draft, '').' '.$Context->GetDefinition('Draft').'</label>
</li> ';
- Spam
- Abuse
0 · Insightful Awesome LOL ·- Spam
- Abuse
0 · Insightful Awesome LOL ·The above issue i mentioned(Blog # 25) solved?
Thanks
- Spam
- Abuse
0 · Insightful Awesome LOL ·- Spam
- Abuse
0 · Insightful Awesome LOL ·- Spam
- Abuse
0 · Insightful Awesome LOL ·- Spam
- Abuse
0 · Insightful Awesome LOL ·- Spam
- Abuse
0 · Insightful Awesome LOL ·- Spam
- Abuse
0 · Insightful Awesome LOL ·- Spam
- Abuse
0 · Insightful Awesome LOL ·However, I got an error, similar to the problem sujang mentioned. When not signed in and browsing the blog, after clicking the sign-in link I receive an error:
Notice: Undefined index: CssClass in /***/html/themes/people_banner.php on line 5I would also love to see delegates used to prevent non-admin to write blog entries.
Is it possible to use the more tag with the ForcedBBCode extension only?
- Spam
- Abuse
0 · Insightful Awesome LOL ·Edit: First comment of blog discussion can't handle attachments. They are uploaded but not shown.
- Spam
- Abuse
0 · Insightful Awesome LOL ·- Spam
- Abuse
0 · Insightful Awesome LOL ·- Spam
- Abuse
0 · Insightful Awesome LOL ·- Spam
- Abuse
0 · Insightful Awesome LOL ·- Spam
- Abuse
0 · Insightful Awesome LOL ·I have a problem with the Latest Discussions Prime extensions. I know this not a bug, and I'm not sure if it's this extension or yours which requires a little hack, but here's the problem. Draft posts are shown in the latest discussions list. Would there be a way to hide them (or even hide the whole blog category)?
- Spam
- Abuse
0 · Insightful Awesome LOL ·- Spam
- Abuse
0 · Insightful Awesome LOL ·- Spam
- Abuse
0 · Insightful Awesome LOL ·- Spam
- Abuse
0 · Insightful Awesome LOL ·- Spam
- Abuse
0 · Insightful Awesome LOL ·$s->AddWhere('cm', 'AuthUserID', '', $D->Context->Session->User->UserID, '=');
==> $s->AddWhere('t', 'Draft', '', '0', '=');
- Spam
- Abuse
0 · Insightful Awesome LOL ·Thanks a lot, it works just fine. The only "problem" is that when you edit the blog post in order to remove the draft status, it's marked as new by Latest Discussions Prime for the autor of the post, but this is definitely not a real problem.
- Spam
- Abuse
0 · Insightful Awesome LOL ·Edit: Ok, I added what you suggested also after line 48, like this :
$s->AddOrderBy('DateCreated', 't', 'desc');$s->AddWhere('t', 'Draft', '', '0', '=');
...and now it seems fine :)
- Spam
- Abuse
0 · Insightful Awesome LOL ·