Get XOOPS XOOPS FAQ Forums News Themes Modules
News World of XOOPS Developers Hacks Modules Themes YAXS Archive Submit News

XOOPS vs. Herko Coomans

Local Support

Make a donation

Please select an amount to donate


Do you want your username revealed with your donation?
Yes - List me as a Generous Donor
No - List my donation as from an Anonymous Donor


Search

Twitter News

Cumulus Tag Cloud

admin Arabic banner block Christmas comments cumulus DayDawn dhsoft e-Commerce E-Learning Google GUI hacks instant-zero jQuery module news Nordic Olédrion oxygen PageRank security SEO simple-XOOPS sport tag Theme wiki xoops

New Users

Registering user

# 116762

maleinfect

Welcome to XOOPS!

Archives

Advertisement

XOOPS Code hosted on SourceForge

TS-My Startup Page goes Blue - version 0.4 released

Posted by Mazarin on 2010/2/5 10:00:00 (1720 reads) | Posted on Modules
The TS-My Startup Page module allows an administrator to specify which module is shown at startup for a specific group after login or for anonymous users, i.e. you can now redirect specific groups of users to a part of your site that suits them with an easy to use administration interface.

This version is a small update to the original 0.3 version.

Changes in this version include:
- Updated to be compatible with XOOPS 2.4.x
- Bugfix relating to user being member of several groups
- Possibility to update start order

Open in new window

Download: Click here

Install:
Read the enclosed installation instructions in install.txt. Please note that this module requires you to add a line to the include/checklogin.php page. A regular update of the module is possible by copying over the old files and updating the module.

Credits: Thanks to culex for QA and "best practice" adjustments


Printer Friendly Page Send this Story to a Friend Create a PDF from the article


Bookmark this article at these sites

                   

The comments are owned by the poster. We aren't responsible for their content.

What an excellent idea! Nice one!
Posted: 2010/2/5 10:11 • Updated: 2010/2/5 10:11
Thank you so much for being part of the "Blue Move"!!!! This is very much appreciated!

I hope, other developers will jump in and help as well!

BTW - could you share with others what changes were required, and what "best practices" did you use?
Posted: 2010/2/5 10:24 • Updated: 2010/2/5 10:25
nice idea for a module and very much needed i think!

however i think with the new version of XOOPS you can use preloaders to avoid hacking core files!

Havent used this yet but i'm sure travis could step in and provide you with some more info on the matter! well done for this module mate. keep up the good work. :)
Posted: 2010/2/5 11:39 • Updated: 2010/2/5 11:39
Yup, use preloader and realise 0.5 :)
Posted: 2010/2/5 13:34 • Updated: 2010/2/5 13:34
I thought the idea with this module was far to good to let it die (and I could see the use for it myself), so I decided to update it. It turned out that in this specific case, it was quite easy.

The only thing breaking this module in 2.4.x was the inclusion of some classes that are now part of the core. Removing the declaration of those classes in the module took care of that. As for PHP5 compliance, no changes were needed.

I'm in no way an expert at this, but working with simple modules like this one and XoopsPoll made me realize that if you put the effort in you may find it's not so hard to update them (the original module developers did all the hard work, for which they deserve all the credit ). I just use common sense and regular tools as the XOOPS debug, NetBeans with CodeSniffer plugin, and Firebug.

Hmmm, thinking about it, it may be worth putting together a short article on how to update modules, where real experts (unlike me) can contribute tips as well.

Regarding preloads, I haven't really had time to look into those, i.e. what they do and how they work. Also, this is another area where we could use documentation (yes, I know we are all aware of the lack of documentation, so this is not to bitch and moan about that), as I wouldn't know where to go to find info on how preloads work in XOOPS. Actually, me being not extremely familiar with the XOOPS core as such, I would love some documentation on what's actually included in the core that can be valuable for me to use in modules.
Posted: 2010/2/5 15:49 • Updated: 2010/2/5 16:27
Quote:
Actually, me being not extremely familiar with the XOOPS core as such, I would love some documentation on what's actually included in the core that can be valuable for me to use in modules.

Yes, that would be very good!

Currently the only option is to look at the API, but it doesn't give you the real overview, unless you are REALLY good in reading code.

Maybe some of the experts could do it for us....
Posted: 2010/2/5 17:19 • Updated: 2010/2/5 17:19
Hi Mazarin..TQ...


take a look of this thread

http://www.xoops.org/modules/newbb/vi ... at&order=ASC&type=&mode=0

example of using preloads
Posted: 2010/2/5 17:28 • Updated: 2010/2/5 17:28
Doesn't work. Preferences don't save. Database stays blank.

Warning: Invalid argument supplied for foreach() in file /modules/startup/admin/admin.php line 55

Lines 54-62;
if ($module_handler->get($module_id)) {             foreach ($group_sel as $grp) {                 if ($group_handler->get($grp)) {                     $newitem $myhandler->create();                     $newitem->setVar('group_id'$grp);                     $newitem->setVar('module_id'$module_id);                     $newitem->setVar('start_order'$order);                     if (!$myhandler->insert($newitemtrue)) {                         $msg _STARTUP_ERROR_FAILURE_SAVE;

Posted: 2010/2/15 18:32 • Updated: 2010/2/15 19:35
Sorry about that. A bit of over sanitizing snuck into the released file. I will arrange for the file to be replaced tomorrow, but if you want a quick fix, please change lines 47 and 48 to look like this:
$module_id $_POST['module_selected'];
$group_sel $_POST['group_selected'];


Edit: I've also updated the SVN so you can download it from there if you don't want to wait.
Posted: 2010/2/15 19:44 • Updated: 2010/2/15 19:58
NEVERMIND. It works now.
Posted: 2010/2/15 20:19 • Updated: 2010/2/15 21:23
THANK YOU!!!! EXCELLENT MODULE!
Posted: 2010/2/15 21:23 • Updated: 2010/2/15 21:23
Quote:
$module_id $_POST['module_selected'];
$group_sel $_POST['group_selected'];
And sanitation, with eg intval()?
Posted: 2010/2/15 22:04 • Updated: 2010/2/15 22:04
Yes, the intval didn't go to well with the array (or whatever similar type) from the listbox in line 48. Line 47 could still keep the intval function I guess.
Posted: 2010/2/16 2:35 • Updated: 2010/2/16 2:35
intval is for checking integer data. There are other functions and techniques for all other data. One part of the move to blue is having save modules, with no risk for XSS.
Posted: 2010/2/16 4:28 • Updated: 2010/2/16 4:28
OK, my bad. Then I suggest we change the heading of this news article to remove any mentioning of "blue" and I will pay special attention never to use that phrase again if not 100% valid.
Posted: 2010/2/16 5:20 • Updated: 2010/2/16 5:20
No, no, it still goes blue!
It is a long way and one have to make it step by step.
Posted: 2010/2/16 13:44 • Updated: 2010/2/16 13:44
NP I'll fix it by tomorrow (didn't have time today).
Posted: 2010/2/16 18:24 • Updated: 2010/2/16 18:24