By dublin drupaller on
Hi guys.
Anyone with a Drupal 4.7.x test site that is willing to help test updates to the front_page.module appreciated. There are 2 new features:
- Front page by role
Allows site admins to setup a custom front page based on role type. Users with multiple roles will get the first role type match based on order (most recent role type is checked first). - Special "mission style" notice for authenticated users who haven't visited the site for a set period of time.
In active users who return to your site after a certain period of time will get a special notice. Site admin can specify the length of time and the message displayed.
The updates are based on suggested improvements to the module by Hivemindz and Nedjo
I've tested the beta module (which is sitting in my sandbox, linked below) in Drupal 4.7.3 but I would prefer if others had a quick test before comitting the updates.
http://cvs.drupal.org/viewcvs/drupal/contributions/sandbox/dublindrupall...
cheers
Dub
Comments
sounds great
Dublin,
that sounds great. I can't test it for a couple of days, but if you still need testers then I'll have. thank you very much.
We have committed the custom
We have committed the custom module to the live website so I will place this new version on the test site and get some more input on it.
Hiveminds Magazine
http://www.hiveminds.co.uk
for web publishers and community builders
thanks
thanks Hiveminds,
my initial guess is that the majority of Drupallers will use the "special notice for inactive users" as a "since you've been away..." type thing....like a postit, so to speak, rather than a full page.
Can you explain the application you are using it in as a full page? I found it hard to think of an application where a full page would be used over a postit mission style message.
Thanks
Dub
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
The project consists of a single Hub site
The project consists of a single Hub site that will gather or have information pushed to it from other websites that are not Drupal. So the reason for having full HTML is so that an aggregate page can be constructed from those sources. It may be RSS feeds,videos, podcasts, ads and what not. Think of it as a brochure of sorts where the site presenting the information is included as a brochure item, so the theme and template are not used.
Hiveminds Magazine
http://www.hiveminds.co.uk
for web publishers and community builders
Is this stable yet?
This module has exactly what I want, but I can't get any of these versions to work. (I guess I'm beta testing.)
The 1.2 version posted here from Sept. 11 doesn't redirect me to the desired view. I just get a blank empty page with a url of http://www.example.com/?time=1158845350 or some such. No error messages, just an empty page.
When I use the explicit URL to test: http://www.example.com/?q=front_page, I get the same blank, empty page.
I tried using a static page and a redirect PHP script with no luck.
Then I tried downloading newer revisions (http://cvs.drupal.org/viewcvs/drupal/contributions/modules/front/), but the latest revision 1.31 (Sept. 18) has a bug in the code.
Missing argument 2 for drupal_get_form() in /home/ten000d/public_html/includes/form.inc on line 61.
quick one..
The newer version you downloaded is for Drupal 5.0.
I've tested it on the latest CVS version of Drupal and it works fine...
If you're using Drupal 4.7.3 download the version from my sandbox.
The new (CVS) version of Drupal has a lot of changes in it, so 4.7 modules won't work with it.
Dub
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
works
Hi Dub,
thanks for this. It's exactly what I need at the moment. Tried the front_page.module in your sandbox with Drupal version 4.7.3 and it works perfectly.
if it's possible, what would be very useful is an option to preview the various pages.
I have 5 role types, so the new feature of having a front_page by role is perfect for what I want, the only minor problem is previewing the different pages. is it difficult to put in a PREVIEW link?
Thanks
Phil
OK, I made the Sept. 11 version work... but it's still flakey
I am using Drupal 4.7.3.
For whatever reason, the second part of the condition below from the code was always true:
|| variable_get("front_2_type", "same") == "same" || variable_get("front_2_text", "") == "")
So it was never getting down to the else where the new front page should be loaded.
I cut that out and it is working for me now.
However, changes to one role seem to affect other roles. It's a little flakey or maybe there's something I should know about how Drupal/Apache cache requests/pages.
Thanks,
Leonard
** snipped from front_page.module
// the following is the code that loads the front_page settings
global $user;
/*
* show this if the user is not logged in or if the authenticated user is to get the same output as
* anonymous users
*/
if ($user->uid==0 ) {
// original condition JLW: ($user->uid==0 || variable_get("front_2_type", "same") == "same" || variable_get("front_2_text", "") == "")
quick one..
Hi villages..
the front page module is designed to work for anonymous users (users with no UID) and authenticated users (users with a UID).
the change you have made means that it will only work for the administrator (you).
i.e.
if ($user->UID==0)means "if the user is the administrator....."the original condition is not as you posted...it's
if (!$user->uid)which means "if the user doesn't have a uid.." in other words, if the user is an anonymous user.I think you've inadvertantly edited your own initial code edit...recommend you delete your hacked version and pull down the original from the sandbox, which works with 4.7.3.
dub
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
Yes is was a bug in the code
We found that the problem was that in reading the variable_get("front_2_text", "") == "" holding a blank textarea's content. For some reason PHP does not want to trim the whitespace more than once. So there is an artifact left over making the condition false. I was tight for time for the presentation so I just removed this bit of the conditionals. I will try to find out why PHP is doing this later.
Hiveminds Magazine
http://www.hiveminds.co.uk
for web publishers and community builders
ammended argument..
hi Heine,
I've changed that argument to this:
Which according to this handbook page about E_ALL compliant code should be a more efficient way of checking whether the variable front_2_text is set or not.
I've tried it on a test bed and it works for me.
I've refreshed the sandbox version of the front page module (For Drupal 4.7) with this update to the code. If you get a chance, I'd appreciate a second opinion.
Dub
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate