[wp-hackers] Hijack "The Loop"?

Lorin Rivers lrivers at gmail.com
Wed Apr 25 19:18:40 GMT 2007


OK, sure. Let me also state the problem I'm trying to solve, instead
of leading with my proposed solution. There are two things I'd like to
do:
1) require a login to view alumni profiles (see below)
2) I think this is the most "post-like" behavior I want: allow
navigation forward and back inside result sets. Once a person has
drilled down to the profile page, I'd like to retain the query that
created the page they came from. In other words, if it's a search by
name, keep that list and forward and back through it. Likewise, if
someone goes to the profile page from the class page (see below), I'd
like to retain that query and allow the same navigation back and
forth.

I've got a table I created in the WP database that contains detailed
information about alumni, pretty standard stuff, name, address, etc.

I display that info in 3 places (page templates all):
1) a class-year page: names with link to alumnus profile page
Here's the query:
<?php
$alumni = $wpdb->get_results("SELECT user_id, last_name, maiden,
first_name, nickname, suffix FROM $wpdb->alumni WHERE class_year =
'$class_year' ORDER BY $order");
?>

Then I build an HTML table with the results (something like 450
records returned)

2) a search results page: names with link to alumnus profile page
3) a alumnus profile page: detailed info about that individual
This is the page I most want to "post-ify" (see above).

THANKS!

On 4/25/07, Alex Günsche <ag.ml2007 at zirona.com> wrote:
> On Wed, 2007-04-25 at 13:22 -0500, Lorin Rivers wrote:
> > Here's what I'm doing--I've got a custom table and some page
> > template-fu to display data that is not "posts". WP is so post-centric
> > that a lot of stuff doesn't work if the content is not in "the loop".
> >
> > Is it possible to make my custom PHP ACT like The Loop? And if so, how?
>
> I'm positive it is, but could you please describe more detailed what
> you're trying to do?
>
> Regards,
> Alex
>
> --
> Alex Günsche, Zirona OpenSource-Consulting
> http://www.zirona.com/ | Hilfe für das HQ AC: http://www.prohq.de
> PubKey for this address: http://www.zirona.com/misc/ag.ml2007.asc
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list