Register Members List Search Today's Posts Mark Forums Read

Reply
 
Article Options
  #91  
Old 29 Dec 2012, 18:27
cultd3ad cultd3ad is offline
 
Join Date: Nov 2007
Hi kh99,

thx to Replay and help me....

Your Info not Work!

I have a failure in the Config or ?
I use the php in the Sidebar Adden and this work fine! Why nothing Work in a Template? I have Read all howto and change some Codes, all not Work
Reply With Quote
  #92  
Old 29 Dec 2012, 22:21
acast acast is offline
 
Join Date: Aug 2008
Hi. I am having a problem, i registered two variables which are in the vbtrade_main template, and i want it to see it only in the php page vbtrade.php, but i see it in all pages! The forum also dissapears.

This is the code i put in the
Hook Location with global_bootstrap_init_start


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

What i am doing wrong?

Thanks for your help.
Reply With Quote
  #93  
Old 30 Dec 2012, 00:30
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Originally Posted by cultd3ad View Post
Hi kh99,

thx to Replay and help me....

Your Info not Work!

I have a failure in the Config or ?
I use the php in the Sidebar Adden and this work fine! Why nothing Work in a Template? I have Read all howto and change some Codes, all not Work
I'm sorry, but I don't understand. I understand that what I posted didn't work, but I don't understand the rest. Did you put that code in a template? It shouldn't go in a template, it needs to go in a plugin.
Reply With Quote
  #94  
Old 30 Dec 2012, 00:33
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Originally Posted by acast View Post
What i am doing wrong?

Thanks for your help.

It might only be that you're missing an ob_start() call. If you want to include two files separately, you would need to call ob_start() again after the first call to ob_end_clean().
Reply With Quote
  #95  
Old 30 Dec 2012, 09:13
acast acast is offline
 
Join Date: Aug 2008
Originally Posted by kh99 View Post
It might only be that you're missing an ob_start() call. If you want to include two files separately, you would need to call ob_start() again after the first call to ob_end_clean().
Still the same with that modification:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

It appears in all pages, and the forum dissapears.

The vbtrade_main template:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #96  
Old 30 Dec 2012, 13:27
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
That looks right, but it may have to do with what's in the scripts you're trying to include. For instance if they call exit() or die(), then that may be why the forum is disappearing. (If vbtrade.php is a vbulletin "powered" page that calls print_output() at the end, that would also do it). If that's the case, then maybe you can use an iframe instead.

Also I just noticed that you're including the same file twice - even if it worked, you'd probably get the same output for both.
Reply With Quote
  #97  
Old 30 Dec 2012, 13:35
acast acast is offline
 
Join Date: Aug 2008
Thumbs up

Originally Posted by kh99 View Post
That looks right, but it may have to do with what's in the scripts you're trying to include. For instance if they call exit() or die(), then that may be why the forum is disappearing. (If vbtrade.php is a vbulletin "powered" page that calls print_output() at the end, that would also do it). If that's the case, then maybe you can use an iframe instead.

Also I just noticed that you're including the same file twice - even if it worked, you'd probably get the same output for both.
The same file twice where?

This is the end of the vbtrade.php

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

How can i use an iframe? Is a tutorial or something here? I never heard that.

Thanks for your answers!


EDIT: An iframe is a bbcode. Do you mean i don't have to put the code in a new plugin, but in the new bbcode? The same code i put in the plugin?
Reply With Quote
  #98  
Old 30 Dec 2012, 13:55
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Originally Posted by acast View Post
The same file twice where?

Both of your 'require_once' lines have the same file name.


This is the end of the vbtrade.php

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

How can i use an iframe? Is a tutorial or something here? I never heard that.
iframe is an html tag (you don't need to create a bbocde to use one in a template).

To be honest I'm not sure what you're trying to do. It looks like you're trying to use the method in this article to include output from an external file (vbtrade.php), but you also have a template. What are you using that template for, and what output do you expect from vbtrade.php? And where are you trying to include it?
Reply With Quote
  #99  
Old 30 Dec 2012, 14:06
acast acast is offline
 
Join Date: Aug 2008
Originally Posted by kh99 View Post
Both of your 'require_once' lines have the same file name.




iframe is an html tag (you don't need to create a bbocde to use one in a template).

To be honest I'm not sure what you're trying to do. It looks like you're trying to use the method in this article to include output from an external file (vbtrade.php), but you also have a template. What are you using that template for, and what output do you expect from vbtrade.php? And where are you trying to include it?
Ok, i'll explain, because perhaps i am wrong.

I am trying to make work a vb3 plugin in vb4, and i see in the template this lines:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

And i read that in vb4 you have to register the variables to make it work, so i thought that i have to register the variables stocktable and preview to make it work. Am i wrong?
Reply With Quote
  #100  
Old 30 Dec 2012, 14:16
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Originally Posted by acast View Post
And i read that in vb4 you have to register the variables to make it work, so i thought that i have to register the variables stocktable and preview to make it work. Am i wrong?

So far that all looks OK. Edit: but I guess the issue is, where are those variables coming from?

Last edited by kh99; 30 Dec 2012 at 14:24.
Reply With Quote
  #101  
Old 30 Dec 2012, 14:24
acast acast is offline
 
Join Date: Aug 2008
Originally Posted by kh99 View Post
So far that all looks OK.
So, i have to make a plugin to register those two variables or what? I am little bit missing right now.
Reply With Quote
  #102  
Old 30 Dec 2012, 14:26
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Well, right, you'd have to do that in php, which means a plugin or modifying a script. But the issue seems to be where those variables are coming from. The code you posted looks like you're trying to capture the entire output of vbtrade.php into each of those variables, which won't work. But I'm not sure what to tell you to do instead of that.

Edit: I'm thinking now that you don't need this "include external files" thing at all. If you're trying to modify vbtrade.php to work with vb4, then you probably want to edit that script and change the way the templates are rendered.
Reply With Quote
  #103  
Old 30 Dec 2012, 16:02
acast acast is offline
 
Join Date: Aug 2008
Originally Posted by kh99 View Post
Well, right, you'd have to do that in php, which means a plugin or modifying a script. But the issue seems to be where those variables are coming from. The code you posted looks like you're trying to capture the entire output of vbtrade.php into each of those variables, which won't work. But I'm not sure what to tell you to do instead of that.

Edit: I'm thinking now that you don't need this "include external files" thing at all. If you're trying to modify vbtrade.php to work with vb4, then you probably want to edit that script and change the way the templates are rendered.
You mean the end of my vbtrade.php?


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

How can i change the way the templates are rendered?
Attached Files
File Type: txt code.txt (26.3 KB, 1 views)

Last edited by acast; 02 Jan 2013 at 10:54.
Reply With Quote
  #104  
Old 30 Dec 2012, 16:10
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
OK, that's already written for vb4, so it doesn't need to be changed. Sorry, I probably just misunderstood what you're trying to do.

You said you're trying to modify a vb3 plugin for vb4, so you were right, if it involved using variables in a template, you might have to register them. Is your vb3 plugin code calling fetch_template() then eval()?

Edit: OK, I just noticed that the code you posted above from vbtrade.php is rendering the vbtrade_main template and already registers $stocktable and $preview, so I'm lost. What does the plugin do?

Last edited by kh99; 30 Dec 2012 at 16:16.
Reply With Quote
  #105  
Old 09 Jan 2013, 13:28
acast acast is offline
 
Join Date: Aug 2008
Originally Posted by kh99 View Post
OK, that's already written for vb4, so it doesn't need to be changed. Sorry, I probably just misunderstood what you're trying to do.

You said you're trying to modify a vb3 plugin for vb4, so you were right, if it involved using variables in a template, you might have to register them. Is your vb3 plugin code calling fetch_template() then eval()?

Edit: OK, I just noticed that the code you posted above from vbtrade.php is rendering the vbtrade_main template and already registers $stocktable and $preview, so I'm lost. What does the plugin do?
Sorry for asking again, friend, but i'm still working on this, and there is no way. I still don't understand if i have to register in plugins, the variables that appear in the "if" in the templates, or if it will work because there are registered in the php.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Article Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 05:14.

Layout Options | Width: Wide Color: