This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

custom gloabal var not in full global scope?

I'm making a module of the Lace Ajax Chat system and having problems with a global var being seen within functions of included php files.

the process tree looks a little like this
---------------------------------------------------------------------
lace.module -> include common.php
common.php -> include multiple files
/lib/classes/LaceData.php
/lib/classes/LaceActivity.php
/lib/lib_utils.php
/lib/lib_lace.php
...more

common.php -> create new instance of laceActivty class
$A = &new LaceActivity();

common.php -> call validateSession() func - inside included 'lib_utils.php'

lib_utils.php (validateSession)
global $A;
echo "\$A is ".gettype($A);
==> "$A is NULL"
---------------------------------------------------------------------

so... $A is not catching scope inside the funcs... if i test it outside a func in the global code of the included files they all see it just fine as the Object, but once inside a func it's a no go.

if i run Lace on it's own on my server, this code and scope has no problem at all so it's something specific to the drupal envirnment that my $A var is not truely getting scoped as global. is there some trick that i have to register a var as a global with drupal or something?

Remove link to Org.Group calendar from event detail

Would someone please offer a fix for the following -- ?

I have a site set up with Organic Groups. When a user clicks on an event to view the event detail, several links appear underneath the event details:
link to main calendar
link to the Org. Group calendar
printer-friendly version

I want to remove the link to the Organic Group calendar. Can someone please tell me where to find this code?

Thanks!

visual confirmation for anonymous comments

hi,
is there a module or method for a visual confirmation (this letter thing) code for anonymous users posting comments?

I looked through the modules and did a search but came up emtpy.

If there is not, I'm thinking of implementing a basic version myself.
I had to disable anonymous comments because bots hit too often these days.

greetings kamika

denying access to specific modules

Hi,

I would like to deny access to anonymous user to certain modules ( book module for example). I tried the taxonomy module and simple access modules.

In simple access module I have to set the access settings in every page. But is there a simple way around this. ?

Karthik

Best way to personalize modules?

What's the best way to personalize a module? I'd say not personalize it at all. ;-) But given I have to adjust a module, let's say the book module.

If I use the OG module, I can't use other node access modules. However, I could either modify the access routine in OG.module or I could modify the book.module. Both options, however, have a drawback. As soon as I update the system, I have to update the book.module myself.

OG: Access methods

I need help of someone who knows the Organic Groups module (og.module). Though it does a lot of great things, it unfortunately renders all node access modules useless, at least this is what its descriptions says.

I need the following access methods. Probably I could emulate them by writing action scripts that create groups on themselves, add the users to it that are allowed to perform an action, set the permission rights and remove them again - if I combine it with the workflow module, it could be possible. However, I don't know the OG module good enough to decide how much work it would be. I'd like to know from an insider how doable the following access methods would be:

- Some users in a group only can "view" posts, others can edit all posts. This is important for certain types of announcement postings that need updating from a group of dedicated helpers without giving everyone in a group the possibility to mess with posts from anyone.

- A book page can be set on status "consider for inclusion" with the workflow module. Once it is set on this status, a group discussion via mailing list ensues. As long as the node is set on this status, the author should not be allowed to edit the node since it would invalidate the ongoing discussion if the content was to change without announcing it first and stopping the discussion.

- Using the "userpoints" module, users can do workshops (essentially read book pages). However, each book page costs userpoints that are substracted. Only users that engage in community activities can continue to read those workshops. How could I handle those access rights? Probably I could reate groups like "workshop_#1_unit_1" to "workshop_#1_unit_20" for every workshop and if a users wants to read unit 2, he has to join the next group (and on joinig userpoints are subtracted), but this seems very clumsy.

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions