Main
Index
Search
Posts
Who's
Online
Log
In

Home: Discontinued/Classic Products: Instant Website: Realty/Listings/Auto:
Increase the number of listings on the Admin Listings page

 

 


kblm
User

Mar 26, 2009, 8:41 AM

Post #1 of 9 (3871 views)
Shortcut
Increase the number of listings on the Admin Listings page Can't Post

On the Listings page in the Admin interface, the number of listings is defaulted to 25. I know I can select more in the perPage dropdown.

Is there anyway to have the default be a higher number? I can't find the file to change that?

-Kevin


ross
Staff / Moderator


Mar 26, 2009, 3:00 PM

Post #2 of 9 (3855 views)
Shortcut
Re: [kblm] Increase the number of listings on the Admin Listings page [In reply to] Can't Post

Hi Kevin

Thanks for posting!

That's a good idea. There isn't an easy way just yet to do that but I've added it to the feature list. I don't know for sure which version it will make it into though.

For now, if you want, I can walk you through a code change to set a new default.

Open up the following file:
/lib/menus/default/list_functions.php

look for this line:
# set defaults

Right after that add this:
$perPage = 3;

Change the 3 to whatever you want it to be. Save and upload.

Thanks!
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Product Specialist
support@interactivetools.com

Hire me!  Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/



kblm
User

Mar 26, 2009, 3:42 PM

Post #3 of 9 (3852 views)
Shortcut
Re: [ross] Increase the number of listings on the Admin Listings page [In reply to] Can't Post


In Reply To
Hi Kevin

Thanks for posting!

That's a good idea. There isn't an easy way just yet to do that but I've added it to the feature list. I don't know for sure which version it will make it into though.

For now, if you want, I can walk you through a code change to set a new default.

Open up the following file:
/lib/menus/default/list_functions.php

look for this line:
# set defaults

Right after that add this:
$perPage = 3;

Change the 3 to whatever you want it to be. Save and upload.

Thanks!


Perfect, worked great.

Let me just say, I really appreciate all the developers taking the time to get customers answers and work arounds to problems.

It also helps that the code is nicely written and clean!

Thanks!

-Kevin


kblm
User

Mar 26, 2009, 4:04 PM

Post #4 of 9 (3849 views)
Shortcut
Re: [ross] Increase the number of listings on the Admin Listings page [In reply to] Can't Post

Ross,

I noticed that while this worked, it seemed to hard code the result set to whatever I placed in the variable. So if I put 100 in, I couldn't force it to only show 25 if I selected 25 and hit Search.

Let me know if this is another work around:

In list_functions.php

I changed this line:

Code
if (!$perPage) { $perPage = getFirstDefinedValue(@$lastState['perPage'], 25); }


To this:

Code
if (!$perPage) { $perPage = getFirstDefinedValue(@$lastState['perPage'], 100); }


Now if I close the browser and log back in, it defaults the list to 100, however it now allows me to change to another value.

If I wanted more, I could change the line to:

Code
if (!$perPage) { $perPage = getFirstDefinedValue(@$lastState['perPage'], 500); }


However, then it seems I need to add another <option> to the select list in list.php

Let me know what you think.

By the way....what stores the value of what option you chose in the search within the browser session? Is it a cookie? For example, if I choose a per page value of 5 from the dropdown and hit search.....that 5 value sticks unless I close the browser.

-Kevin


kblm
User

Mar 26, 2009, 4:08 PM

Post #5 of 9 (3847 views)
Shortcut
Re: [kblm] Increase the number of listings on the Admin Listings page [In reply to] Can't Post


In Reply To
By the way....what stores the value of what option you chose in the search within the browser session? Is it a cookie? For example, if I choose a per page value of 5 from the dropdown and hit search.....that 5 value sticks unless I close the browser.

-Kevin


Ok, I'm guessing that it's stored in the session cookie *_editorStates

-Kevin


ross
Staff / Moderator


Mar 27, 2009, 10:47 AM

Post #6 of 9 (3807 views)
Shortcut
Re: [kblm] Increase the number of listings on the Admin Listings page [In reply to] Can't Post

Hi Kevin

Yes, the values are stored in cookies and the code I suggested basically overrides this. Could you swap my code from yesterday with this:

if (!$perPage) { $perPage = 2; }

That will check if you select something from the drop down and use it instead of the default. The code goes in the exact sample place.

Let me know what you think :).
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Product Specialist
support@interactivetools.com

Hire me!  Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/



kblm
User

Mar 31, 2009, 6:29 PM

Post #7 of 9 (3687 views)
Shortcut
Re: [ross] Increase the number of listings on the Admin Listings page [In reply to] Can't Post


In Reply To
Hi Kevin

Yes, the values are stored in cookies and the code I suggested basically overrides this. Could you swap my code from yesterday with this:

if (!$perPage) { $perPage = 2; }

That will check if you select something from the drop down and use it instead of the default. The code goes in the exact sample place.

Let me know what you think :).


Ross,

That setting did not seem to have any affect. I think it's due to the previous line above in that file:

if (!$perPage) { $perPage = getFirstDefinedValue(@$lastState['perPage'], 25); }

The 25 in that line is what causes the system to default to the per page option of 25. If I change that to 100, and make sure that in list.php there is a <option <?php selectedIf($listDetails['perPage'], '100')?>>100</option> in the code, then I default to 100.

-Kevin


(This post was edited by kblm on Apr 1, 2009, 1:48 PM)


ross
Staff / Moderator


Apr 1, 2009, 1:04 PM

Post #8 of 9 (3602 views)
Shortcut
Re: [kblm] Increase the number of listings on the Admin Listings page [In reply to] Can't Post

Hi Kevin

Just wanted to make sure this was working for you. I am thinking the problem may have been I started from scratch again when I did the second post.

Let me know if you still need a hand with this and we'll go from there. Thanks!
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Product Specialist
support@interactivetools.com

Hire me!  Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/



kblm
User

Apr 1, 2009, 1:47 PM

Post #9 of 9 (3596 views)
Shortcut
Re: [ross] Increase the number of listings on the Admin Listings page [In reply to] Can't Post

Ross,

I do have the functionality working.

I just changed this line:
if (!$perPage) { $perPage = getFirstDefinedValue(@$lastState['perPage'], 25); }

To this:
if (!$perPage) { $perPage = getFirstDefinedValue(@$lastState['perPage'], 100); }

Then I needed to just make sure that in list.php there is a <option <?php selectedIf($listDetails['perPage'], '100')?>>100</option> in the code.

Everything is working perfect now.

Thanks for the followup.

-Kevin


(This post was edited by kblm on Apr 1, 2009, 1:47 PM)