61
Mithrandir
Re: Need a answer to the following question please!

Sorry m0nty, but I have to rebuff what you say here.

Quote:

you should use include_once() instead of require_once for mainfile.php

Include or require is not important here, if the include cannot find the mainfile.php, the $xoopsDB call will throw a fatal error anyway.

Quote:

instead of having $uname = ..........

you could omit that and use >

'uname'=> xoops_getLinkedUnameFromId($this->getVar('uid'));

First off, $this is not defined when in the global scope, so this will throw a fatal error.
Secondly, there is absolutely no need to make another database call when you already have the information you want in the $xoopsUser object, so what he is doing is correct.

Quote:

$tpl = new XoopsTpl();

on the other hand is wrong. You do not manually instantiate the XoopsTpl object as it is done in header.php

Quote:

$sql = $xoopsDB->query("SELECT groupid FROM ".$xoopsDB->prefix('groups')." WHERE name='Affiliate'");

Strictly speaking, what you have is not an SQL statement in the variable, but a DB resultset, so calling the variable $sql is misleading.
Also, querying the groups table directly instead of through the group or member handler class is a nono.
AND querying for a hardcoded group name is... in the lack of a better term... poor. You could use a module configuration option for selecting the proper group.

Quote:

$tpl->append('affs', array(
'uid'=>$uid,
'uname'=>$uname,
'linkurl'=>$linkurl,
'payment'=>$payment,
'groupid'=>$groupid));

No biggie, but append() adds another dimension to the array in Smarty, which is only really useful, when you call it several times. In this case, it would make the template easier to follow if you use assign()

Quote:
$tpl->display(XOOPS_ROOT_PATH . "/modules/affiliate/templates/affiliate_index.html");

Again, not needed. Just set $xoopsOption['template_main'] = "affiliate_index.html";
preferably before including header.php

Quote:
users seem to get admin rights to the rest of the site and when they come out of my module the admin rights stay.

Can you detail it more? Are people actually getting admin rights or does the "Administration menu" link just turn up in their user menu? What can they admin?
"When you can flatten entire cities at a whim, a tendency towards quiet reflection and seeing-things-from-the-other-fellow's-point-of-view is seldom necessary."

Cusix Software



62
Mithrandir
Re: Part 2 of my tutorials

Might want to add something about sanitizing the output, too.

SQL injections are not the only danger for a module.
"When you can flatten entire cities at a whim, a tendency towards quiet reflection and seeing-things-from-the-other-fellow's-point-of-view is seldom necessary."

Cusix Software



63
Mithrandir
Re: EvenNews 1.00 - Create NewsLetter gives a blank page

enable PHP debug in System module's general preferences so we can have something to go by
"When you can flatten entire cities at a whim, a tendency towards quiet reflection and seeing-things-from-the-other-fellow's-point-of-view is seldom necessary."

Cusix Software



64
Mithrandir
Re: What module to use for Q & A

SmartFAQ springs to mind.
"When you can flatten entire cities at a whim, a tendency towards quiet reflection and seeing-things-from-the-other-fellow's-point-of-view is seldom necessary."

Cusix Software



65
Mithrandir
Re: joined the club this weekend...

Congrats, Kaotik.

Have a really great honeymoon and enjoy the first days as a married man.
"When you can flatten entire cities at a whim, a tendency towards quiet reflection and seeing-things-from-the-other-fellow's-point-of-view is seldom necessary."

Cusix Software



66
Mithrandir
Re: bytes -> Mb

Myalbum/submit.php line 306:

$size_label = new XoopsFormLabel_ALBM_MAXSIZE $myalbum_fsize . ( empty( $file_uploads_off ) ? "" ' &nbsp; <b>"file_uploads" off</b>' ) ) ;

to
$size_label = new XoopsFormLabel_ALBM_MAXSIZE , ($myalbum_fsize/1048576) . ( empty( $file_uploads_off ) ? "" ' &nbsp; <b>"file_uploads" off</b>' ) ) ;

(or just divide by 1000000 if you want the easy number)
and change
define("_ALBM_MAXSIZE""Max file size(byte)");

to
define("_ALBM_MAXSIZE""Max file size(MB)");

in language/[yourlang]/main.php line 61
"When you can flatten entire cities at a whim, a tendency towards quiet reflection and seeing-things-from-the-other-fellow's-point-of-view is seldom necessary."

Cusix Software



67
Mithrandir
Re: Displaying total number of registered users

or use the frickin' API
$criteria = new Criteria('level'0'>');
$member_handler =& xoops_gethandler('member');
$active_users $member_handler->getUserCount($criteria);
echo 
$active_users;
"When you can flatten entire cities at a whim, a tendency towards quiet reflection and seeing-things-from-the-other-fellow's-point-of-view is seldom necessary."

Cusix Software



68
Mithrandir
Re: Blank php block

1) PHP debug showing anything?
2) $options should be an array when calling the function
"When you can flatten entire cities at a whim, a tendency towards quiet reflection and seeing-things-from-the-other-fellow's-point-of-view is seldom necessary."

Cusix Software



69
Mithrandir
Re: Were is promo at top for people to vote for best CMS?

I'm both for and against this. I mean, it should be promoted again, now it's going into the final week of voting (ending on November 7th) but just like with the XOOPS site of the month awards, I'd really like it to be more than a popularity contest.

Naturally, I'd like XOOPS to be up there at the top, but it should be because it is a good system, not because of more users in the community than other systems. I know that the competition ends with judges assessing the systems, so XOOPS will not win an undeserved win in any case, but people should vote because they feel it is the best system, not because of marketing.

So let's get a reminder into the spotlight, but don't go overboard with plastering promo all over the site, please.
"When you can flatten entire cities at a whim, a tendency towards quiet reflection and seeing-things-from-the-other-fellow's-point-of-view is seldom necessary."

Cusix Software



70
Mithrandir
Re: CBB - Internal IP Address range being transmitted - how?

/Frameworks/art/functions.user.php

function mod_getIP()
"When you can flatten entire cities at a whim, a tendency towards quiet reflection and seeing-things-from-the-other-fellow's-point-of-view is seldom necessary."

Cusix Software




TopTop
« 1 ... 4 5 6 (7) 8 9 10 ... 506 »



Login

Who's Online

186 user(s) are online (113 user(s) are browsing Support Forums)


Members: 0


Guests: 186


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits