MU Advanced: Issues and Discussion
Welcome Guest
  • Good afternoon, Guest.
    Please log in, or register.
  • September 03, 2010, 12:10:29 PM
Home Forums Contact Tags FAQ Links News Login Register
* *
Navigation Menu
Search

Random Quotes
There is a theory which states that if ever anybody discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.
There is another theory which states that this has already happened.

- Douglas Adams
Pages: [1]   Go Down
  Print  
Author Topic: Trying my best to paginate list-all plugin, but my best isn't good enough  (Read 1554 times)
0 Members and 1 Guest are viewing this topic.
awarner20
Newbie
*

Karma: 0
Offline Offline

Posts: 24


View Profile
« on: June 01, 2008, 08:33:27 PM »

I've been trying to figure out how to paginate the results of the list-all plugin. So far, I've been able to limit the results to a certain number, and output a link when that number is reached.

The problem is that I'm not sure what to do next. This is the code I used to accomplish the above:

Code:
//my additions here
$blogcount = count($blog_list);
if ($blogcount == "6") {
echo "<a href=http://example.com>More Blogs</a>";
} else echo "";

Can anyone here point me in the right direction, and please dumb it down so I can try and muddle through?
Logged
drmike
Gate Keeper
*****

Karma: 3
Offline Offline

Posts: 2228



View Profile WWW
« Reply #1 on: June 01, 2008, 08:51:44 PM »

To be honest, I don't do it.  On most of our installs, 50-90% of the blogs are either empty or not worth having people look at them.

It's a fair amount of pressure on the processor anyway.

Once an hour, we run through all of the blogs and export out data into a new database table, depending on what needs to be done with that data.  One one site, we grab the number of reads within the last 24 hours to see how busy a blog is.  On another site, it's the number of comments made within the last 24 hours.  Along with url, name, etc.

For what reason are you trying to do a list-all list?  Maybe there's a better solution here than that plugin.

edit: Please note I'm going home now.
Logged

awarner20
Newbie
*

Karma: 0
Offline Offline

Posts: 24


View Profile
« Reply #2 on: June 01, 2008, 09:48:44 PM »

Thanks for the reply drmike,

You've raised some valid points, and ones I should be concerned with for sure, maybe I'm on the wrong road all together.

The initial catalyst for using this plugin was to create a "blog directory" link from my main site's front page so potential users and just visitors could explore the blogs contained on my install. I was using this plugin in it's standard form until I installed the most recent Avatars plugin from WPMU Premium. Because these blog Avatars look so slick, I searched for some help on how to display these in the list-all results, and received some help by way of a modified list-all plugin from Trent Adams.

Taking your suggestions into account, I suppose my ultimate goal now would be to output the blogs (with the blog avatar, name, and url) that have had recent posts (last seven days), or recent comments, or some other variable that would get as close to guaranteeing that it is indeed an "active" blog.

Whatever method I ultimately learn how to do, I hope that I will be able to figure out how to "page through" the results and display these blog avatars in a "grid", or two or three columns.

Thanks for taking the time to assist me with this, I really appreciate it:)
Logged
drmike
Gate Keeper
*****

Karma: 3
Offline Offline

Posts: 2228



View Profile WWW
« Reply #3 on: June 02, 2008, 07:57:51 AM »

How about a random list of ten blogs that "have been updated" (ie posts or comments) within the last seven days?
Logged

awarner20
Newbie
*

Karma: 0
Offline Offline

Posts: 24


View Profile
« Reply #4 on: June 02, 2008, 10:48:19 AM »

Yeah, I think that something like that would be my best bet at this point.

Ideally this would display the blog avatars and return 20 or 30 results in several rows or columns. The end goal in my head now would be to fill at least one page with these linked avatars.

If I could accomplish this, and use the "One Search" and "Random Blog Redirect" plugins, I think this would cover my "blog directory" needs.

I just want to give my users a nudge to explore other user blogs...
Logged
Luke
Key Master
*****

Karma: 5
Offline Offline

Posts: 3710



View Profile WWW
« Reply #5 on: June 02, 2008, 11:12:00 AM »

The "easiest" way to go about the whole thing would be to just grab X number of random blogs from the database, controlling results through the where portion of the query, and going from there.

1 query will do it, and if you want to be really anal about it, you can cache the output and only run that once every 15 minutes or so.
Logged

10 frames?
Heh, that's for Quakers.

Note: This message may be Canadian friendly.

"Pornographic monster on the floor"
awarner20
Newbie
*

Karma: 0
Offline Offline

Posts: 24


View Profile
« Reply #6 on: June 02, 2008, 11:21:02 AM »

I'll give that a shot Luke, thanks.
Logged
Luke
Key Master
*****

Karma: 5
Offline Offline

Posts: 3710



View Profile WWW
« Reply #7 on: June 02, 2008, 11:24:09 AM »

It really isn't too difficult. Make a query, then print out the results so you can see what's returned. Tweak and modify, add a little more code that plays with the results, print out its results, etc.

Once everything is as you expect, you can remove the testing code that prints out your info, and be done.

Logged

10 frames?
Heh, that's for Quakers.

Note: This message may be Canadian friendly.

"Pornographic monster on the floor"
awarner20
Newbie
*

Karma: 0
Offline Offline

Posts: 24


View Profile
« Reply #8 on: June 02, 2008, 03:39:23 PM »

Thanks Luke,

I'm going to "chew" on this.
Logged
Luke
Key Master
*****

Karma: 5
Offline Offline

Posts: 3710



View Profile WWW
« Reply #9 on: June 02, 2008, 03:45:02 PM »

You're welcome.
Logged

10 frames?
Heh, that's for Quakers.

Note: This message may be Canadian friendly.

"Pornographic monster on the floor"
ZappoMan
Full Member
***

Karma: 1
Offline Offline

Posts: 157



View Profile
« Reply #10 on: June 04, 2008, 03:32:30 PM »

Quote
Once an hour, we run through all of the blogs and export out data into a new database table, depending on what needs to be done with that data.  One one site, we grab the number of reads within the last 24 hours to see how busy a blog is.  On another site, it's the number of comments made within the last 24 hours.  Along with url, name, etc.

Hey, I wonder if people have an opinion about this approach VS using wp hooks to do the same thing... by that I mean, implement a hook for new post, edit post, delete post, etc, that just does an insert or update on this "new database"...

In theory, the hook thing allows your global database to be more accurate, and probably shouldn't be that much load. You still get the performance boost on the page render of having the list already generated without walking the blogs.

I assume this is how wp.com does tag surfer, comment surfer, and blog/friend surfer.

Thoughts?
Logged

Yep, that's me... riding my bike 204 miles in one day.
Tags: paginate  list-all 

Pages: [1]   Go Up
  Print  
 
Jump to:  


Login
 
 
Recent Posts
Recent Topics
No new topics.
Hot Tags
Whos Online
8 Guests, 0 Users
Home Forums Contact Tags FAQ Links News Login Register