NP_Ordered 1.0 Set order of items and categories

Post your new plugins here!
User avatar
Monkeybrain
Posts: 525
Joined: Thu Dec 15, 2005 1:30 pm
Location: Kristiansand, Norway
Contact:

Postby Monkeybrain » Tue Feb 24, 2009 9:00 pm

I'm getting this error on the Edit Item page:

Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 59 in /var/www/01/12/20/fkradar.no/www/nucleus/plugins/NP_Ordered.php on line 276

It appears just above NP_Ordered in the Extra Plugins field on the Edit Item pages.
It does not appear when I try to post a new item.

I'm currently using v1.31

I'l try upgrading and see if that helps.
Is your question not solved yet?
Search our FAQ,
read the Documentation, or
browse the list of available plugins.
ftruscot
Nucleus Guru
Nucleus Guru
Posts: 7430
Joined: Wed Feb 22, 2006 6:19 pm
Location: Massachusetts
Contact:

Postby ftruscot » Tue Feb 24, 2009 9:14 pm

Monkeybrain,

This is what is fixed in the 1.32 version. I suspect you are trying to edit an item that was created by a regular (non-admin, non-blogadmin) user.

Replace the 1.31 files with the 1.32 files (actually, only NP_Ordered.php has changed from 1.31). Then uninstall the plugin and re-install it from the admin area.
Is your question not solved yet?
Search our FAQ,
read the Documentation, or
browse the list of available plugins.

Check out my plugins
ftruscot
Nucleus Guru
Nucleus Guru
Posts: 7430
Joined: Wed Feb 22, 2006 6:19 pm
Location: Massachusetts
Contact:

Postby ftruscot » Sat Feb 28, 2009 7:53 am

Now at 1.33:

* 1.33 - 02/28/2009 -
* * fix bug where blogs created after installation of NP_Ordered do not get inserted into plug_ordered_bloglist
* * add reversename, short, reverseshort to special sort orders for bloglist type.
* * add parameter format to allow min and max order values to be specified for blog, categorylist, and bloglist

Upgrade, and check the help file for details and examples of new features. See wiki for download link.
Is your question not solved yet?

Search our FAQ,

read the Documentation, or

browse the list of available plugins.



Check out my plugins
User avatar
Dobermann
Posts: 47
Joined: Tue Apr 28, 2009 10:32 am
Location: Las Vegas
Contact:

Postby Dobermann » Tue May 19, 2009 7:20 am

I have but one blog category, and cannot get the order of the items to work properly. Using Pixel Green skin in case that makes a difference. In the Admin Control panel, left hand side, I select Layout | Skins. Under the Edit Skins heading I select Default. Within that, I next choose Main Index and replace:

<%blog(default/index,10)%>

with

<%Ordered(blog,ordered,default/index,10)%>

save, then test. Presently I have but two items. No matter how I try setting them, 0 & 1 or 1 & 2, it always lists the newest on top rather than what I want when I test the page. It does, however, list them correctly in the Admin Control panel.

What am I not seeing here? Even my Dobermann has tried to sniff it out for me, but he cannot find it -- and he has a scent detection snoz that is highly trained :wink:

Thanks,
Dobermann
Please Vote for A Dobermann Named Bambi - He's a Rescue who needs you AND your friends' votes:

http://bit.ly/hSFZI9 Woof Woo! (that's Thank You in dog-speak)
ftruscot
Nucleus Guru
Nucleus Guru
Posts: 7430
Joined: Wed Feb 22, 2006 6:19 pm
Location: Massachusetts
Contact:

Postby ftruscot » Tue May 19, 2009 12:53 pm

You are using the pixel green skin, so you will need to replace the blog variable in the main index skin part of that skin, not the default skin. And the template you use in the Ordered variable should be one for the pixel green skin.
Is your question not solved yet?

Search our FAQ,

read the Documentation, or

browse the list of available plugins.



Check out my plugins
User avatar
Dobermann
Posts: 47
Joined: Tue Apr 28, 2009 10:32 am
Location: Las Vegas
Contact:

Postby Dobermann » Tue May 19, 2009 11:58 pm

ftruscot wrote:You are using the pixel green skin, so you will need to replace the blog variable in the main index skin part of that skin, not the default skin.


I think that was the one I was editing, wasn't it? It can be confusing at times for someone brand new to this and php. Update - I guess that was not the one I was editing, even though the Admin Control brought it up under Skins (see prev post for how I found it). Definitely confusing. I have reset this "default" skin back to <%blog(default/index,10)%> .


And the template you use in the Ordered variable should be one for the pixel green skin.


Okay, I will try guessing the correct name and format, and see what happens. Update - I changed the name to pixelgreen/skintypes/mainindex and it did finally work, but now it changed the layout on me! If it makes any difference, I used DW and just pulled pixelgreen/skintypes/mainindex.php locally, added the line & uploaded it back.

This is what the pixelgreen/skintypes/mainindex.php file now looks like, in its entirity:

Code: Select all

<div id="main">
<%Ordered(blog,ordered,default/index,6)%>
</div>
</div></div>


Being the first time I looked at this file, I have to wonder why it has two more

Code: Select all

</div>
than

Code: Select all

<div>
entries. Is this unbalance correct? I guess I could pull them out and see if it fixes the strange problem that Ordered has somehow created.

The Add Comment and Edit Item has moved from the bottom of the item to the top of the item now, no longer is there a grey border between items (as was previously created by the presence of the Comment & Edit links), and my Digg icon was duplicated in the original post and added to the 2nd post (even though I did not put the code in for it).

I have now taken out the Digg code from where I put it, cleared by browser's cache, and I still have the Digg icon like it used to be.

This is becoming quite frustrating..... and I am yet to start to figure out my FancierURL issues...... sigh........

Thanks,
Dobermann
Last edited by Dobermann on Wed May 20, 2009 1:24 am, edited 2 times in total.
Please Vote for A Dobermann Named Bambi - He's a Rescue who needs you AND your friends' votes:



http://bit.ly/hSFZI9 Woof Woo! (that's Thank You in dog-speak)
ftruscot
Nucleus Guru
Nucleus Guru
Posts: 7430
Joined: Wed Feb 22, 2006 6:19 pm
Location: Massachusetts
Contact:

Postby ftruscot » Wed May 20, 2009 12:06 am

You shouldn't have to guess. You are using the pixel green skin, so go to the Layout->Skins page of the admin area and find the row for Pixel Green. Then click on the Main Index part. There you will see a blog skinvar tag that tells you the template being used. Maybe like pixelgreen/index. Replace that blog skinvar with the appropriate Ordered skinvar using the same template.

That blog skinvar may be in a skins/pixelgreen/skintypes/mainindex.php file if Suveroff did the Pixel Green skin.
Is your question not solved yet?

Search our FAQ,

read the Documentation, or

browse the list of available plugins.



Check out my plugins
User avatar
Dobermann
Posts: 47
Joined: Tue Apr 28, 2009 10:32 am
Location: Las Vegas
Contact:

Postby Dobermann » Wed May 20, 2009 1:30 am

I think I was editing my last post while you were responding to it. I have to admit, I never scrolled down the screen to the skins section. I saw the "default" area and that screen section, and thought that was all there was. It must be a female thing :oops:

The file did turn out to be as you suggested Suveroff would have done, but this has raised a new problem now that it is working, as I explained above in my edit.

Thanks so much for your help!
Dobermann

PS - It looks fine if you select Archives and look at it as an archive, but it is wrong on the Index page.
Please Vote for A Dobermann Named Bambi - He's a Rescue who needs you AND your friends' votes:



http://bit.ly/hSFZI9 Woof Woo! (that's Thank You in dog-speak)
ftruscot
Nucleus Guru
Nucleus Guru
Posts: 7430
Joined: Wed Feb 22, 2006 6:19 pm
Location: Massachusetts
Contact:

Postby ftruscot » Wed May 20, 2009 2:20 am

I'll download the pixel green skin tomorrow and take a look at it.

I think your formatting issue is because you are having Ordered use the item formatting of the default/index template in the structure of the pixel green skin.

Try <%Ordered(blog,ordered,pixelgreen/index,6)%>
Is your question not solved yet?

Search our FAQ,

read the Documentation, or

browse the list of available plugins.



Check out my plugins
User avatar
Dobermann
Posts: 47
Joined: Tue Apr 28, 2009 10:32 am
Location: Las Vegas
Contact:

Postby Dobermann » Wed May 20, 2009 2:31 am

It works! It works! Oh, Frank, you are an angel!!!

Now I'm off to try to solve my FancyrURL problems.

Thanks ever so much again!
Dobermann
:D :D :D :D :D
Please Vote for A Dobermann Named Bambi - He's a Rescue who needs you AND your friends' votes:



http://bit.ly/hSFZI9 Woof Woo! (that's Thank You in dog-speak)
User avatar
Dobermann
Posts: 47
Joined: Tue Apr 28, 2009 10:32 am
Location: Las Vegas
Contact:

Postby Dobermann » Wed May 20, 2009 7:39 am

One more question if I may.... am I missing a setting or will it now be necessary to order each and every blog item? If I do not assign it an order, it does not post.

Thanks again,
Dobermann
Please Vote for A Dobermann Named Bambi - He's a Rescue who needs you AND your friends' votes:



http://bit.ly/hSFZI9 Woof Woo! (that's Thank You in dog-speak)
ftruscot
Nucleus Guru
Nucleus Guru
Posts: 7430
Joined: Wed Feb 22, 2006 6:19 pm
Location: Massachusetts
Contact:

Postby ftruscot » Wed May 20, 2009 12:17 pm

The second parameter determines what is shown. 'ordered' shows only ordered items, 'unordered' shows only unodered items, and 'all' shows both starting with the ordered items, followed by the unordered items in the normal newest-first order.

Try <%Ordered(blog,all,pixelgreen/index,6)%>
Is your question not solved yet?

Search our FAQ,

read the Documentation, or

browse the list of available plugins.



Check out my plugins
User avatar
Dobermann
Posts: 47
Joined: Tue Apr 28, 2009 10:32 am
Location: Las Vegas
Contact:

Postby Dobermann » Thu May 21, 2009 7:16 am

Yep, that fixed it!

Thanks again!
Dobermann
Please Vote for A Dobermann Named Bambi - He's a Rescue who needs you AND your friends' votes:



http://bit.ly/hSFZI9 Woof Woo! (that's Thank You in dog-speak)
User avatar
WebMaster9000
Posts: 249
Joined: Mon Jan 17, 2005 10:12 pm
Location: Brooklyn, NY
Contact:

Postby WebMaster9000 » Tue Jun 09, 2009 1:36 pm

Please excuse my lack of knowledge here but I need a hand figuring out how to use (if possible) this plugin to achieve the following:

I want to display items from two separate blogs (1: news, 2: photos) they both use the same skin only modified for how it shows the items. what i want to do is have the items run straight, show 20 items from both blogs in the order the were published (time and date) and they should each use the skin and template that is set in the nucleus settings.

Can NP_Orderd do this?
ftruscot
Nucleus Guru
Nucleus Guru
Posts: 7430
Joined: Wed Feb 22, 2006 6:19 pm
Location: Massachusetts
Contact:

Postby ftruscot » Tue Jun 09, 2009 1:50 pm

Not really. It is made to be a <%blog%> replacement and is much the same code. NP_ShowBlogs allows you to mix items from different blogs, but doesn't give the ability to use different templates for different categories.

So I think nothing does exactly what you are trying to do. I have thought about extending Ordered to mix items from different blogs, maybe I'll take a look at what that would entail.
Is your question not solved yet?

Search our FAQ,

read the Documentation, or

browse the list of available plugins.



Check out my plugins
User avatar
WebMaster9000
Posts: 249
Joined: Mon Jan 17, 2005 10:12 pm
Location: Brooklyn, NY
Contact:

Postby WebMaster9000 » Tue Jun 09, 2009 2:24 pm

ftruscot wrote:Not really. It is made to be a <%blog%> replacement and is much the same code. NP_ShowBlogs allows you to mix items from different blogs, but doesn't give the ability to use different templates for different categories.

So I think nothing does exactly what you are trying to do. I have thought about extending Ordered to mix items from different blogs, maybe I'll take a look at what that would entail.

Truth is all I really want is that the items should use a different template, no categories or anything like that, just display items from two different blogs which the only difference between them is the template but not the skin.
ftruscot
Nucleus Guru
Nucleus Guru
Posts: 7430
Joined: Wed Feb 22, 2006 6:19 pm
Location: Massachusetts
Contact:

Postby ftruscot » Tue Jun 09, 2009 2:52 pm

There's nothing in the blog settings that can be used to determine what template to use. The blog settings define the skin and variables (like <%blog%>) in the skin call templates to format their output. Other than by convention (of which their are at least two different ones), there is no way guess the template from the skin name.

Right now Ordered allows the template used for index and item pages to be set per category, not per blog. So you would need to set the templates for each category.

The problem is that Ordered does not mix items from different blogs in a single variable call. It's this that I would need to look into doing in a new release.
Is your question not solved yet?

Search our FAQ,

read the Documentation, or

browse the list of available plugins.



Check out my plugins
User avatar
WebMaster9000
Posts: 249
Joined: Mon Jan 17, 2005 10:12 pm
Location: Brooklyn, NY
Contact:

Postby WebMaster9000 » Tue Jun 09, 2009 5:09 pm

ftruscot wrote:There's nothing in the blog settings that can be used to determine what template to use. The blog settings define the skin and variables (like <%blog%>) in the skin call templates to format their output. Other than by convention (of which their are at least two different ones), there is no way guess the template from the skin name.

Right now Ordered allows the template used for index and item pages to be set per category, not per blog. So you would need to set the templates for each category.

The problem is that Ordered does not mix items from different blogs in a single variable call. It's this that I would need to look into doing in a new release.

Aha, I understand.

So lets say instead of using a separate blog I just use category's, how would I be able to set all items to display with the default template and all item in the 'photo gallery' category be displayed with a custom index and item template?
ftruscot
Nucleus Guru
Nucleus Guru
Posts: 7430
Joined: Wed Feb 22, 2006 6:19 pm
Location: Massachusetts
Contact:

Postby ftruscot » Tue Jun 09, 2009 5:31 pm

Have you installed the plugin yet?

There is an admin page for the plugin, which by default has a lnik in the quickmenu at the bottom of the left navigation bar in the admin area. You would go there, choose the blog you want to manage and then choose the categories tab. For the photos category, set the index template and item template fields to the templates you have created to display these items.

Now in the Main Index skin part, replace <%blog(default/index,20)%> with <%Ordered(blog,all,default/index,20)%> (or whatever is the appropriate template for the regular items). If the item pages should use a different template also, go to the Item pages skin part and replace <%item(default/item)%> with <%Ordered(item,default/item)%> again using the appropriate template for regular items.
Is your question not solved yet?

Search our FAQ,

read the Documentation, or

browse the list of available plugins.



Check out my plugins
ryl3y
Posts: 3
Joined: Thu Jun 11, 2009 10:03 pm

Static pages thingmie...

Postby ryl3y » Thu Jun 11, 2009 10:20 pm

Hey, reaching out for some helpe here as im new to Nucleus itself but am keen...

I have been trying to do the following for a few hours without any success and im wondering if anyone can just tell me where im going wrong.

Ok, I have my site, now I have setup the install etc and added some catagories and then found this plugin to order them. set that up ok and all seems fine, now I think that on my home page I would like to make it look slightly different, for example, remove the "posted by" bit as its going to be more of a static introduction to the site.

No matter what I do I cannot get it to use a different template for any of it. Im using the default template design for now so I can experiment. I have setup a new template and called it "homepage" but it will not be called at any point. Do I need a skin with it? Do i need to have to create a new skin as well or am i missing the point here with this?
the other issue is that on this homepage I only want the one posting to show, but Im getting all of them still, even though i have ordered them. The catagories work fine.

Another question, when it asks you for the Index Template and Item Template, in what format should I be entering this?

Can anyone please help someone in need, Id like just a step by step guide, nothing fancy, but it would really make my day (ok, night).

Sorry if this is not clear.

Ryl3y.

Return to “Plugin Development”