51
dreamgear
Re: custom block, type PHP
  • 2003/11/10 3:27

  • dreamgear

  • Friend of XOOPS

  • Posts: 78

  • Since: 2002/7/18


Simple solution:

Quote:

global $var_one;

function func_one()
{
global $var_one;
print "I am func_one<br />\n";
print "var_one is: $var_one <br />\n";
}

$var_one = "Hello World";

print "I am main<br />\n";
print "var_one is: $var_one <br />\n";

func_one();


This does work, as expected. Problem solved.



52
dreamgear
Re: custom block, type PHP
  • 2003/11/10 2:38

  • dreamgear

  • Friend of XOOPS

  • Posts: 78

  • Since: 2002/7/18


Well, here's one problem. Try this in a "PHP Script" block:

Quote:

function func_one ()
{
global $var_one;
print "I am func_one<br />\n";
print "var_one is: $var_one <br />\n";
}

$var_one = "Hello World";

print "I am main<br />\n";
print "var_one is: $var_one <br />\n";

func_one();


Why can't my function see $var_one ? Is there any way around this, other than passing all the globals in to the function?



53
dreamgear
Re: custom block, type PHP
  • 2003/11/10 1:42

  • dreamgear

  • Friend of XOOPS

  • Posts: 78

  • Since: 2002/7/18


Is anyone using a custom block of type "PHP Script" for anything? I just spent a half hour looking through search results and it seems just about everybody finds them unusable.

What restrictions are there on the use of PHP in these blocks?



54
dreamgear
custom block, type PHP
  • 2003/11/9 22:52

  • dreamgear

  • Friend of XOOPS

  • Posts: 78

  • Since: 2002/7/18


I wrote a php script that does a little "scraping" from another site and outputs some HTML, and I'm trying to use it in a custom block in XOOPS 2.0.5.

It doesn't seem to work.

I know the "fopen" works because some of the data is returned, but lots of other things go wrong, like my preg_match calls failing where they shouldn't, etc.

I ran the script in PHP command line mode on the hosting co's system and it works just fine.

Can anyone provide any hints on using PHP in custom blocks in general?

I'm wondering if XOOPS is changing some defaults that my script is depending on, and what they might be.



55
dreamgear
Re: Headlines module: a couple of questions
  • 2003/10/17 14:50

  • dreamgear

  • Friend of XOOPS

  • Posts: 78

  • Since: 2002/7/18


bump...



56
dreamgear
Re: Question about Agenda-X module
  • 2003/10/16 3:20

  • dreamgear

  • Friend of XOOPS

  • Posts: 78

  • Since: 2002/7/18


I have a hacked version of this module that takes care of this problem. After it's been tested a little more I will offer it back to Wang Jue and/or make it available somehow.



57
dreamgear
Headlines module: a couple of questions
  • 2003/10/15 12:16

  • dreamgear

  • Friend of XOOPS

  • Posts: 78

  • Since: 2002/7/18


First, when the headlines are displayed on the block, clicking on them takes me to the headlines page. Wouldn't it be better to take me directly to the story ? Something tells me the old headlines module for XOOPS 1.x worked that way.


Second, I have been trying to use feeds from prweb.com, and XOOPS doesn't seem to like them. The files are there, but they don't work. For example see this feed: http://www.prweb.com/xml/daily.xml

Any thoughts on why they don't work?

They're ad supported, apparently, but they're free without restrictions as far as I can see, which is a lot different from the oft-abused moreover and newsisfree feeds.



58
dreamgear
Re: time zone offsets in Xoops
  • 2003/10/15 4:45

  • dreamgear

  • Friend of XOOPS

  • Posts: 78

  • Since: 2002/7/18


Fwiw, it's xoops_getUserTimestamp().. which is in include/functions.php.

Just what the Dr. ordered.



59
dreamgear
time zone offsets in Xoops
  • 2003/10/14 16:09

  • dreamgear

  • Friend of XOOPS

  • Posts: 78

  • Since: 2002/7/18


I'm going to take a stab at modifiying Wang Jue's agendax module to use the xoops-defined time zone offsets. The current version seems to always display dates and times in the server's time zone.

What is the correct way for a script to access that information ? Any pointers or information or code references would be appreciated.




60
dreamgear
Re: HTML problem in XOOPS and Other CMS?
  • 2003/9/10 14:59

  • dreamgear

  • Friend of XOOPS

  • Posts: 78

  • Since: 2002/7/18


The problem has been discussed and a fix proposed in the wfsections forum.




TopTop
« 1 ... 3 4 5 (6) 7 »



Login

Who's Online

193 user(s) are online (122 user(s) are browsing Support Forums)


Members: 0


Guests: 193


more...

Donat-O-Meter

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

Latest GitHub Commits