Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2012, 05:38:32 PM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
155544 Posts in 21714 Topics by 7736 Members
Latest Member: chris85
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Enhanced Aggregator module ready for download  (Read 1095 times)
sparkdigital

Offline Offline

Posts: 348



WWW
« on: May 02, 2011, 02:38:32 PM »

Hi,

Paul van de Westhuizen of Westhouse IT created an enhanced aggregator mod for me. It now enables you to pick which pages you would to show in your aggregator section. So you're no longer limited to the pages that appear in the child folder but you can show pages from anywhere in the site. A jQuery plugin allows you to add/remove the pages and move them up/down in the list.

I'm currently using it on http://www.romanticretreats.co.uk/special-offers.php to show the holiday cottages that have special offers. Also for any alterations in the CSS for this mod you can look at the css sheet for that page.

Any questions please ask.

Konrad
Logged
Argos
Moderator
**
Offline Offline

Posts: 2161


WWW
« Reply #1 on: May 04, 2011, 11:19:58 AM »

That sounds great, thanks for sharing! Maybe it can be the official replacement for http://www.websitebakers.com/pages/modules/listings/section-pages/aggregator_mod.php
Logged

Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase: http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
Paul - Westhouse IT

Offline Offline

Posts: 63


WWW
« Reply #2 on: May 04, 2011, 12:30:49 PM »

Yup, that's the idea. Smiley

Rather than release it as a new version I wanted to change the name since "aggregator_mod module" sounded kinda weird.
Logged

Westhouse IT - Professional WebsiteBaker developers for hire.
lausianne
WebsiteBaker Org e.V.

Offline Offline

Posts: 155


WWW
« Reply #3 on: September 01, 2011, 03:25:02 PM »

Has anyone tried this with 2.8.2?

I get this error message on the settings page:
Code:
Notice: Undefined index: summary_id in ...\modules\enhanced_aggregator\modify.php on line 162/>
And then several more errors when trying to save:
Code:
Notice: Undefined index: use_page_id_list in ...\modules\enhanced_aggregator\save.php on line 30
Notice: Undefined index: use_thumbnail in ...\modules\enhanced_aggregator\save.php on line 39
Notice: Undefined index: use_summary in ...\modules\enhanced_aggregator\save.php on line 59
Notice: Undefined index: page_browser_top in ...\modules\enhanced_aggregator\save.php on line 92
Notice: Undefined index: page_browser_bottom in ...\modules\enhanced_aggregator\save.php on line 93

?

Thank you!
Cheers, Ralf.
« Last Edit: September 01, 2011, 03:29:31 PM by lausianne » Logged
Paul - Westhouse IT

Offline Offline

Posts: 63


WWW
« Reply #4 on: September 01, 2011, 04:34:56 PM »

The errors are actually because the code in the original module accessed certain variables in the $_POST array. Like so:

$aggregate_hidden = (($_POST['aggregate_hidden'] == '1')) ? 1 : 0;


To save me the time looking at the changes for $_POST access in 2.8.2, does anyone know correct code for the example above?

Thanks.
Logged

Westhouse IT - Professional WebsiteBaker developers for hire.
DarkViper
Development Team
*****
Offline Offline

Posts: 1253


« Reply #5 on: September 04, 2011, 01:24:39 PM »

an easy way to sanitize and preset a numeric POST-value

get_posts() returns the value or even 'null' if argument is missing
intval() castes any not numeric value, 'null'  and '0' also  into (int)0.
the ternary operator makes sure that  '1' only results in a (int)1 and any other value results in (int)0

Code:
<?php

$aggregate_hidden 
= ((intval($wb->get_post('aggregate_hidden')) === 1)) ? 0;

?>
(instead of $wb-> you can use $admin-> for backend also)

It's normal PHP nothing special from 2.8.2
Logged

Anleitungen lesen und selber nachdenken ist anstrengend...  Da lass ich doch lieber andere für mich denken...

In 1984:  Nineteen Eighty-Four is a unrealistic utopia!!
In 2012:  Nineteen Eighty-Four is a little piece only of our reality!!
Paul - Westhouse IT

Offline Offline

Posts: 63


WWW
« Reply #6 on: September 04, 2011, 03:25:38 PM »

I think I was a bit vague in my first reply. "Undefined index:" means that those entries don't exist in the $_POST array. Therefore either those array entries were unset, or they weren't sent in the first place. It seems far more reasonable that they weren't sent/set.

While it is true that directly using the $_POST array without santizing is a bad idea, it should still work. Therefore the problem is due to a change in 2.8.2. But since I don't have the time at the moment to set up a 2.8.2 dev environ and test & fix the problem, I'll need to leave that to someone else.

P.S. You can also cast as int instead of using intval(). Also, type casting isn't needed in your alternative if you use ==, since the comparison operator will auto-cast as int to compare to the int on the other side. It just depends on whether you want to be explicit or not.
Logged

Westhouse IT - Professional WebsiteBaker developers for hire.
pcwacht
AddOn Development
*
Offline Offline

Posts: 2858



WWW
« Reply #7 on: September 04, 2011, 04:06:28 PM »

They are NOT errors but notices.
Could be due to different errorlevel settings in php or in backend of WB

In short, those notices could have been there all along.
It is just php telling you you use a variable wich wasn't set before.

Code:
$somevariable = '';
echo $somevariable;
differs from
Code:
echo $somevariable;
The latter might fire the notice.


John
Logged

http://www.ictwacht.nl = Dutch ICT info
http://www.pcwacht.nl = My first
both still work in progress, since years.....
Paul - Westhouse IT

Offline Offline

Posts: 63


WWW
« Reply #8 on: September 04, 2011, 04:23:46 PM »

Just checked quickly, and you're right John, they were there all along.

Please ensure that on a live site display_errors is "Off" and error_reporting is set to the default of "E_ALL & ~E_NOTICE" or less.

Ideally these bugs should be fixed. Is anyone interested in improving this module further?
Logged

Westhouse IT - Professional WebsiteBaker developers for hire.
lausianne
WebsiteBaker Org e.V.

Offline Offline

Posts: 155


WWW
« Reply #9 on: September 05, 2011, 08:06:51 AM »

Well, thanks for your comments. I would not mind a few notices, that I can switch off. But I get no frontend output of the aggregator. Also, droplets that I have on an aggregator page don't work. I see the droplet code instead [[...]].
(client coming in tomorrow, so I have no time for further testing today, sorry ...)

Cheers,
Ralf.
 
Logged
pcwacht
AddOn Development
*
Offline Offline

Posts: 2858



WWW
« Reply #10 on: September 05, 2011, 09:58:46 AM »

Seems to be missing some preprocess

Not tested:
Open up view.php
change  line 232
Code:
$page_source .= ob_get_contents();

to

Code:
$page_source .= $wb->preprocess(ob_get_contents());

If this doens't work try
Code:
$page_sourcetemp = ob_get_contents();
$page_source .= $wb->preprocess($page_sourcetemp);

Have fun,
John
Logged

http://www.ictwacht.nl = Dutch ICT info
http://www.pcwacht.nl = My first
both still work in progress, since years.....
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!