|
|
#1 |
|
The Master
Join Date: Mar 2006
Location: British in Argentina
Posts: 1,400
Rep Power: 46 ![]() ![]() |
Sorry buts its a long time since I have messed around with modules and have a basic question.
On my includes/init.php I have several custom variables that I use throughout the program. They appear on everypage but they dont assign when using a module? Any reason for this?
__________________
**Bulk Upload System** has been upgraded. Works on all v4 versions with new functionality. Free upgrade for existing customers. |
|
|
|
|
|
#2 |
|
68 Classifieds Staff
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,291
Rep Power: 123 ![]() |
The only reason I would think they wouldn't appear is if they have been redefined some where else.
__________________
Eric Barnes 68 Classifieds Developer Please do not send me a private message asking for support. Instead use these open forums or our ticket system. Customer Area | Issue Tracker | Documentation | 68C Mods | Submit a Ticket | 68 @ Twitter | My Modules |
|
|
|
|
|
#3 |
|
The Master
Join Date: Mar 2006
Location: British in Argentina
Posts: 1,400
Rep Power: 46 ![]() ![]() |
Nope, its a very strange one, I can get by creating a new functions file inside the actual module, but ovbiously if I edit one, I have to remember to edit the other.
__________________
**Bulk Upload System** has been upgraded. Works on all v4 versions with new functionality. Free upgrade for existing customers. |
|
|
|
|
|
#4 |
|
Coder
Join Date: Mar 2006
Posts: 4,742
Rep Power: 115 ![]() ![]() ![]() |
Are these variables being assigned within the module itself or is the module pulling them from elsewhere?
Are you sure the variable is getting properly assigned within the module function? Have you tried to echo or print the variables within your module function to make sure they are getting properly assigned?
__________________
Larry What I post here should be used only as a guide to point you in the right direction. If the code I post doesnt make any sense or work as posted then you should spend more time reading the various manuals and tutorials so it does make sense and you can tweak it to work. A sure fire way to get yourself in trouble is to implement changes you dont have an intimate understanding of. Im happy to help, but I am not here to teach you to code or create your site for you. |
|
|
|
|
|
#5 |
|
The Master
Join Date: Mar 2006
Location: British in Argentina
Posts: 1,400
Rep Power: 46 ![]() ![]() |
Like I say the variables work fine on every other page except for the module page. They are not being pulled from anywhere else and are not appearing inside the debug window.
What I think is happening is that php variables are being allowed but the smarty variables arent.
__________________
**Bulk Upload System** has been upgraded. Works on all v4 versions with new functionality. Free upgrade for existing customers. |
|
|
|
|
|
#6 |
|
Coder
Join Date: Mar 2006
Posts: 4,742
Rep Power: 115 ![]() ![]() ![]() |
Without knowing a little more I can only guess whats going on. Just trying to make sure we are on the same page.
When you say the "variables" are you using php variables in other php scripts or on template pages? Are you assigning the php variables to smarty variables in your module?
__________________
Larry What I post here should be used only as a guide to point you in the right direction. If the code I post doesnt make any sense or work as posted then you should spend more time reading the various manuals and tutorials so it does make sense and you can tweak it to work. A sure fire way to get yourself in trouble is to implement changes you dont have an intimate understanding of. Im happy to help, but I am not here to teach you to code or create your site for you. |
|
|
|
|
|
#7 |
|
The Master
Join Date: Mar 2006
Location: British in Argentina
Posts: 1,400
Rep Power: 46 ![]() ![]() |
Yes and no.
I have some global variables that I placed inside my init.php so I dont have to edit every page to call them. Some are php variables and some are assigned to smarty. For example, $testmaff="testmaff"; $class_tpl->assign('testmaff2', $testmaff); I can use the php variable but the smarty isnt being parsed.
__________________
**Bulk Upload System** has been upgraded. Works on all v4 versions with new functionality. Free upgrade for existing customers. |
|
|
|
|
|
#8 |
|
Coder
Join Date: Mar 2006
Posts: 4,742
Rep Power: 115 ![]() ![]() ![]() |
Have you specified you want $class_tpl to be globally available? If not, then your smarty assignment will not work.
to do so, inside the function, right under the function specify class_tpl is global...ie Code:
global $class_tpl;
__________________
Larry What I post here should be used only as a guide to point you in the right direction. If the code I post doesnt make any sense or work as posted then you should spend more time reading the various manuals and tutorials so it does make sense and you can tweak it to work. A sure fire way to get yourself in trouble is to implement changes you dont have an intimate understanding of. Im happy to help, but I am not here to teach you to code or create your site for you. |
|
|
|
|
|
#9 |
|
The Master
Join Date: Mar 2006
Location: British in Argentina
Posts: 1,400
Rep Power: 46 ![]() ![]() |
Only part of my module is written as a function and this the hook part that interacts with each page. This element is working fine.
Leave it Larry, its friday after all.
__________________
**Bulk Upload System** has been upgraded. Works on all v4 versions with new functionality. Free upgrade for existing customers. |
|
|
|
|
|
#10 |
|
Moderator
|
Just a thought, how are you including these variables for global use? If you are including/defining these from mod_user.php which hook are you setting? I remember I had a problem with the start hook because it is loaded before the language hook.
__________________
John Snyder PHP Developer |
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|