1
Bassman
Module PHP assistance please :)
  • 2004/8/5 1:39

  • Bassman

  • Friend of XOOPS

  • Posts: 1272

  • Since: 2003/5/23


I stumbled across a E-Xoops module called E-Xoops tools, which is basically a collection of Javascript programs for webmasters - HTML to PHP Converter, HTML to ASP Converter,
HTML to Javascript Converter, CSS scrollbar maker, popup window maker, HTML editor, email encoder etc - 17 scripts in all, bundled as an E-Xoops module. Surprisingly, it works in XOOPS 2.06 without any modifications at all. It did have a list of PHP notices and warnings, which i've all but eliminated, except for one. I get the following PHP notice when PHP debug is turned on:
Quote:
Notice [PHP]: Undefined variable: func in file modules/exoopstools/index.php line 2809


It doesn't seem to affect the operation of the module at all. Line 2809 is:
Quote:
switch($func) {


I don't know enough about PHP to answer this, but how can the script function if a variable isn't defined?

I'd like to get this fixed so I can release the module as a XOOPS module. Anyone have any ideas? Perhaps it's something that gets defined in the normal E-Xoops mainfile?

2
Catzwolf
Re: Module PHP assistance please :)
  • 2004/8/5 1:47

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


Hey Bassman!

Quote:

Bassman wrote:
Quote:
Notice [PHP]: Undefined variable: func in file modules/exoopstools/index.php line 2809


It doesn't seem to affect the operation of the module at all. Line 2809 is:
Quote:
switch($func) {



From what I can see this is a switch, what this means that $func could be assigned a variable from 1 to 10, but there will always be a default for this switch. So if $func is empty or 0 then it will use this defualt value.

ie

switch($func)
{

case 1:
do this;
break;

case 2:
do that;
break;

case 3:
default:
we will do this instead;
break;

}

So if $func is empty or doesn't equal 1 or 2 then it will default to 3.

edit: Surprised that it worked with XOOPS 2 but hey who cares as long as it does


Hope that helps

ATB

Catz

3
Bassman
Re: Module PHP assistance please :)
  • 2004/8/5 1:53

  • Bassman

  • Friend of XOOPS

  • Posts: 1272

  • Since: 2003/5/23


Catz,
Thanks for the quick reply.
That's exactly what it does do.

So, should I define it somewhere? Or just ignore it? :P

4
Catzwolf
Re: Module PHP assistance please :)
  • 2004/8/5 2:07

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


Just ignore it

5
Catzwolf
Re: Module PHP assistance please :)
  • 2004/8/5 2:08

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


Wait, you could do a back trace to find out where it was defined (if it was) and it could be a register global problem. So I would check for them ok.

Talk later Bassman

6
Dave_L
Re: Module PHP assistance please :)
  • 2004/8/5 2:10

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


Depending on how the variable is used, it could be a security risk to leave it uninitialized. But you'd have to examine the code closely to determine that.

7
m0nty
Re: Module PHP assistance please :)
  • 2004/8/5 2:18

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


these tools are already available ported to XOOPS 2

you can find them here: http://t-tech.org/

*note* at this time it seems the site is down but check back regularly..

for a demo i found this site using them: http://www.eulisse.com/modules/T-TechTools/

8
Bassman
Re: Module PHP assistance please :)
  • 2004/8/5 2:20

  • Bassman

  • Friend of XOOPS

  • Posts: 1272

  • Since: 2003/5/23


OK
*puts on dunce cap*
I'm not that smart. How do I do that?

I've got it installed at http://www.bassmanthemes.x8r.com , i'll make it available for anon if you want to have a look...

9
Bassman
Re: Module PHP assistance please :)
  • 2004/8/5 2:25

  • Bassman

  • Friend of XOOPS

  • Posts: 1272

  • Since: 2003/5/23


Monty,
Yeah, that's some of the same things. Not all of them though.

BTW I have a Beagle called Monty :P

10
m0nty
Re: Module PHP assistance please :)
  • 2004/8/5 2:30

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


lmao.. not you aswell

my girlfriend does too i hate it when she shouts me sayin dinners on the table and the dog beats me to it..

Login

Who's Online

198 user(s) are online (110 user(s) are browsing Support Forums)


Members: 0


Guests: 198


more...

Donat-O-Meter

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

Latest GitHub Commits