Banner
ORODHA 1.1.1 RELEASED!   click here!

Display search_ results_classID on Page Editor page?

Display search_ results_classID on Page Editor page?

I seem to remember there was a "search results addon" on the OR forum that would allow you to display results on a page created in the page editor? Anyone know a) where it is and? b) does it work with Orodha?
Or if there is another way to display results for a particular class ID on a editor created page?

Appreciate any help or advice.

Edited By: 4sbo
Jan-23-11 01:14:35

4sbo
Giving back!
ranks
useravatar
Offline
131 Posts
User info in posts
Administrator has disabled public posting

Re: Display search_ results_classID on Page Editor page?

Yes, there must be a simple hardcoded php query for that, I'd like to know what it is...and any other useful php snippets for grabbing things from the database. In fact, if they are that "simple" (and they likely are) then we should turn them into template tags. {show_all_results}, {show_all_results_pclassX}. Great for site maps apart from anything else.

Tom ("zarathustra" on OR)  is proud to be a member of the Orodha development team!
OrodhaDesign provides quality design services to make your Orodha website perform.
Proven track history and portfolio - Orodha design services
I hope I helped you today! - If you love Orodha, please donate  to fund its continued development!

orodhadesign
Orodha Dev Team
ranks
useravatar
Offline
429 Posts
User info in posts
Administrator has disabled public posting

Re: Display search_ results_classID on Page Editor page?

try this inside your template file
require_once($config['basepath'] . '/include/search.inc.php');
$search = new search_page();
$data = $search->search_results();
$display $data;

Ive not tried that but do know if a searchresults was added to the case statement in the core.inc.php you coudl use {searchresults} to display them all on your page.

alsmith
Al Smith
Orodha Dev Team
ranks
useravatar
Offline
417 Posts
User info in posts
Administrator has disabled public posting

Re: Display search_ results_classID on Page Editor page?

I added {searchresults} and {searchresults_class_#} as available tags to be used within the pages to the SVN.

alsmith
Al Smith
Orodha Dev Team
ranks
useravatar
Offline
417 Posts
User info in posts
Administrator has disabled public posting

Re: Display search_ results_classID on Page Editor page?

Thanks alsmith for the help, but I'm not sure I fully follow you, are you suggesting I add the code you submitted in the pageX_main.php file?
and what do I then add to the editor page?
Sorry for the dumb sounding questions, but I'm a bit of a noob at this.  smile

4sbo
Giving back!
ranks
useravatar
Offline
131 Posts
User info in posts
Administrator has disabled public posting

Re: Display search_ results_classID on Page Editor page?

the code was submitted to the SVN, it is not available until tested and if so included in the next release.
The first code I suggested you would need to put above or below the {content} in your pages template file. like page1_main.php if you wanted it to show in that page.
<?php
require_once($config['basepath'] . '/include/search.inc.php');
$search = new search_page();
$data = $search->search_results();
$display $data;
?>
{content}

I think that will put it just abouve your content. LIke I said I did not test this myself

alsmith
Al Smith
Orodha Dev Team
ranks
useravatar
Offline
417 Posts
User info in posts
Administrator has disabled public posting

Re: Display search_ results_classID on Page Editor page?

alsmith, I tried the code, and got the following:
Parse error: syntax error, unexpected T_VARIABLE in /home/xxxxxxx/xxxxxxx/template/orodha/page5_main.php on line 28

4sbo
Giving back!
ranks
useravatar
Offline
131 Posts
User info in posts
Administrator has disabled public posting

Re: Display search_ results_classID on Page Editor page?

Hi Al, Great news that this is in the core now! So many possibilities. Is there a way we can grab just "specific" things from the database? I am rubbish at php>mysql interaction. For instance what would the php code to grab just a list of listing titles be (great for site maps)? How about to grab the total number of listings? Total number in each class? Things like that? Very useful for template designers.

If I knew the php I think I could build them as tags too...so we'd be able to do things like:

Code:

<h1>Welcome to BigShotLtd! Listing {total_listings_number} widgets right now!</h1>

I also would like to know how to pull specific "simple" items from the control panel setup. So I can do:

Code:

<p>Showing listings on the map within {config_listing_map_distance} of this property</p>

...for example smile

Tom ("zarathustra" on OR)  is proud to be a member of the Orodha development team!
OrodhaDesign provides quality design services to make your Orodha website perform.
Proven track history and portfolio - Orodha design services
I hope I helped you today! - If you love Orodha, please donate  to fund its continued development!

orodhadesign
Orodha Dev Team
ranks
useravatar
Offline
429 Posts
User info in posts
Administrator has disabled public posting

Re: Display search_ results_classID on Page Editor page?

Oh I see it should be $display = $data;
I left out the =
also you many need global $config; on the line after the starting <?

alsmith
Al Smith
Orodha Dev Team
ranks
useravatar
Offline
417 Posts
User info in posts
Administrator has disabled public posting

Re: Display search_ results_classID on Page Editor page?

Tom you could use functions like this one in the admin to get the total listing count.
<?php
global $config;
require_once($config['basepath'].'/include/admin.inc.php');
$listing = new general_admin();
$total_listings = $listing->listing_count();
$active_listings = $listing->listing_count('yes');
$inactive_listings = $listing->listing_count('no');
$featured_listings = $listing->listing_count('featured');
$expired_listings = $listing->listing_count('expired');
?>
Now you hav a variable $total_listings you could use. Notice also the others.

alsmith
Al Smith
Orodha Dev Team
ranks
useravatar
Offline
417 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
885
Total Polls:
0
Total Posts:
33558345
Posts this week:
6
User Info:
 
Total Users:
840
Newest User:
Soifer
Members Online:
0
Guests Online:
83

Online: 
There are no members online

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked