Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions

Reply
 
Thread Tools Display Modes
  #21  
Old 05-21-2003, 01:56 PM
gmarik's Avatar
gmarik gmarik is offline
 
Join Date: May 2002
Location: Mocsow
Posts: 1,288
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Guys, how can I include php in every template I need?
I mean require and so on. Tried a hack called PHP Embed - it does not works for me. Sos!
Reply With Quote
  #22  
Old 05-21-2003, 03:04 PM
filburt1 filburt1 is offline
 
Join Date: Feb 2002
Location: Maryland, US
Posts: 6,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Please start your own thread, don't hijack somebody else's...
Reply With Quote
  #23  
Old 05-22-2003, 03:17 AM
Boeman Boeman is offline
 
Join Date: Apr 2003
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Yesterday at 01:47 PM Logician said this in Post #20
ok before Xenon gets angry let's listen to him: :glasses: So edit index.php, find:

PHP Code:
global $bbforumview
After that add:
PHP Code:
global $testing
As per your instructions (and Xenon's) I was able to display some text using the variable. Thank you both.

With the usefulness of the simple example now past, I attempted to add in some php code in the phpinclude template but it seems I pushed my luck a bit too far. It was a basic count script to display TESTING 123 three times:

$testing =

($i = 0; $i < 3) {

echo "TESTING 123"

}

I know this breaks the no echo rule for phpinclude but what would be a way to incorporate external php in this manner?

Thanks again.
Reply With Quote
  #24  
Old 05-22-2003, 01:55 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

that is no valid php code here.

You should really learn to code php correctly before trying to hack vb.
There are good books out to learn the basics of php, you won't get it by just try and whenever there is an error ask here...
Reply With Quote
  #25  
Old 05-22-2003, 02:13 PM
Boeman Boeman is offline
 
Join Date: Apr 2003
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Today at 03:55 PM Xenon said this in Post #24
that is no valid php code here.

You should really learn to code php correctly before trying to hack vb.
There are good books out to learn the basics of php, you won't get it by just try and whenever there is an error ask here...

I have written some php code on an external file that DOES WORK. My only problem here as I see it, is that I'm having difficulties implementing it within formbit templates. I have created similar variables all linked to other php files within phpinclude which work correctly on the header and footer templates. Formbit, as I'm lead to believed, works differently and that is now my only hurdle.

No, I'm certainly no expert in PHP, but little examples are all the push I need here.

Thanks in advance.
Reply With Quote
  #26  
Old 05-22-2003, 02:17 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
$testing =

(
$i 0$i 3) {

echo 
"TESTING 123"


this code has more than one error in just 4 lines, so don't tell me that would work somewhere else.

to write valid php it should look somehow like that:

PHP Code:
for ($i 0$i 3$i++) {

echo 
"TESTING 123";


Reply With Quote
  #27  
Old 05-22-2003, 02:38 PM
Boeman Boeman is offline
 
Join Date: Apr 2003
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Today at 04:17 PM Xenon said this in Post #26
PHP Code:
$testing =

(
$i 0$i 3) {

echo 
"TESTING 123"


this code has more than one error in just 4 lines, so don't tell me that would work somewhere else.

to write valid php it should look somehow like that:

PHP Code:
for ($i 0$i 3$i++) {

echo 
"TESTING 123";


I wasn't actually referring to that block of code in my last post but nonetheless, it still doesn't work in phpinclude. How do you get that to work correctly in phpinclude so I can use it in formbit templates?
Reply With Quote
  #28  
Old 05-26-2003, 09:38 PM
Boeman Boeman is offline
 
Join Date: Apr 2003
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

bump
Reply With Quote
Reply

Thread Tools
Display Modes

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

Forum Jump


All times are GMT. The time now is 04:10 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07652 seconds
  • Memory Usage 2,242KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (6)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete