Home | Products | Consulting | Forums | Support | Order | 1-800-752-0455
  Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder:
Need help pulling database info into a list

 

 


TonyRC65
Novice

Jun 3, 2008, 3:10 PM

Post #1 of 7 (660 views)
Shortcut
Need help pulling database info into a list Can't Post

Ok, this is a little confusing even for me and I'm the one that knows what I'm trying to do so stick with me here!

On the front page of the site I'm building, there is a box for featured writers. The space will have a small photo of the writer along with their name that will link to a bio page. That part I can figure out. Where I'm stuck is I also want to display a short list, maybe 2 or 3, of their most recent articles next to their name on the front page. The information is gathered by the database when they type the original articles into other sections of the site. I just don't know how to extract it and make it display on the front page.

To add another twist to the whole thing... I have more writers than will fit on the main page. I only want to display about 4 or 5. I need the list of photos, names, and articles (all grouped together by person) to change dynamically based on whoever wrote the most recent article.

I think I'm in over my head on this one but I'm betting someone here might be able to help me out.

Thanks!

Tony


(This post was edited by TonyRC65 on Jun 4, 2008, 11:19 AM)


Dave
Staff / Moderator


Jun 4, 2008, 9:30 AM

Post #2 of 7 (641 views)
Shortcut
Re: [TonyRC65] Need help pulling database info into a list [In reply to] Can't Post

Hi Tony, welcome to the CMS Builder forum! :)

So let me just make sure I'm clear on your setup. You have section editors setup for writers and articles. Is that right?

And on the frontpage you want to show the 3 writers who have most recently created an article? And beside their name you want a list of the 5 most recent articles (sorted by created date) that they have created?

Let me know if that's right and I'll give you some code for that. Also, if you have an url with a mockup that would be helpful.

Dave Edis - Senior Developer
interactivetools.com


TonyRC65
Novice

Jun 4, 2008, 11:14 AM

Post #3 of 7 (639 views)
Shortcut
Re: [Dave] Need help pulling database info into a list [In reply to] Can't Post

Yup, sounds good! I probably only need to display the titles of each person's 3 most recent articles, not 5, but otherwise that sounds right.

I'm not sure which database field to use to guarantee that each article they type is matched to the author. The articles they will each write are going to be under the section editor labeled "Staff Contributors" while their photo and biography information is located in the standard CMS section "Staff Bios".

Here's a link to what will be the main page of the site where I need this to display. You can see the Staff Contributors area in the bottom right.

http://www . rescue cuts . com

I'll also need the same type of thing for the staff bios list page which will include ALL of the articles each contributor has written listed next to their name as seen here: http://www . rescue cuts . com /bio_list.php

If you need access to the CMSAdmin area, I'll setup an account for you to look around. Just let me know.

Thanks!


(This post was edited by TonyRC65 on Jul 7, 2008, 5:14 PM)


Dave
Staff / Moderator


Jun 4, 2008, 3:20 PM

Post #4 of 7 (624 views)
Shortcut
Re: [TonyRC65] Need help pulling database info into a list [In reply to] Can't Post

Hi Tony,

Yea, if you could email me CMS login details to dave@interactivetools.com (email, don't post login details to the forum) that would help. Then I'll post some code back here and make sure I have your fields right.

I don't think it's possible to get the "latest posters" through CMS Builder directly, but we should be able to do it with a short MySQL query.

Email me some login details for your CMS Builder and I'll write something up.

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com


Dave
Staff / Moderator


Jun 5, 2008, 11:33 AM

Post #5 of 7 (609 views)
Shortcut
Re: [TonyRC65] Need help pulling database info into a list [In reply to] Can't Post

Hi Tony,

Let's start with the bio list because that will be simpler and then we can build up from there.

There's multiple writers on the bio page right now. What articles do you want listed along the side? Or do you want the articles listed under the persons bio?

Dave Edis - Senior Developer
interactivetools.com


TonyRC65
Novice

Jun 5, 2008, 1:20 PM

Post #6 of 7 (605 views)
Shortcut
Re: [Dave] Need help pulling database info into a list [In reply to] Can't Post

The bio page is essentially the way I want it now minus the articles list for each person who writes articles.

I'm not sure what the best way to attack the article list is. If necessary, I can create a user account for each person who will be submitting articles. If I do that, the database should be able to pull the correct articles into the list simply by searching for all articles written by a particular user ID right?

Is there a better way that wouldn't require creating accounts for them? If I do create accounts for them, can I have the articles they write go to a pending state before being visible on the site like in the old article manager?

Currently, there are no articles on the site by any of the featured writers. I'm holding off posting any until I figure out the best method of doing so.

Essentially, the home page, the bio list page, and the individual bio pages will all have someone's name, photo, title, and a list of the articles they've written.


(This post was edited by TonyRC65 on Jun 5, 2008, 1:22 PM)


Dave
Staff / Moderator


Jun 5, 2008, 4:48 PM

Post #7 of 7 (598 views)
Shortcut
Re: [TonyRC65] Need help pulling database info into a list [In reply to] Can't Post

Hi Tony,

If you want writers to only be able to see their own articles and not modify anyone else's, the best way is to setup separate accounts.

Once you've done then yes you can list articles that were created by specific accounts.

If, however, you only have one person who will be updating the site and they are a trusted user than you could just have a text field or pulldown for writer name.

Assuming you go with the multiple account method, the way to have new articles not appear is to create the special field "hidden" as a checkbox. Then give it a default value of "checked" and set it to "Admin Only". This will cause all new articles to be hidden until an admin user sets them to unhidden.

Hope that helps. Let me know if that makes sense and which part you want to work on first.

Dave Edis - Senior Developer
interactivetools.com

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Support
Online Documentation
Support Forums
Support Homepage
Company Info
12 reasons to choose us!
Meet the team
Monthly newsletter
Contact Us
Toll Free: 1-800-752-0455
Phone: (604) 689-3347
Sales | Support
Conditions of Use | Privacy Policy | Copyright © interactivetools.com 2008
#201 - 2730 Commercial Drive, Vancouver BC Canada V5N 5P4