Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
new to php Details »»
new to php
Version: , by Mickie D Mickie D is offline
Developer Last Online: May 2017 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 03-23-2003 Last Update: Never Installs: 0
 
No support by the author.

i am making my own little programme for my members

lets start from the start:

my members would like a page where they could put in a location and on the other page it shows good places around that area...

this is how my code looks so far

<?php
include("global.php");

eval("dooutput(\"".gettemplate("places")."\");");

///// START PLACES CODE /////
if ($Your_Town == "London") {
$GoodSpot = "Bagleys night club";
}

///// END PLACES CODE /////


?>

this is all called from a "post" command and a text box on the page b4 this, so if they put london i want it just to say bagleys

i know if i was not using the forums templates i could put

print ="bagleys";

and just have a normal php page ... but i really like it intergrated into my forums, please help

can someone tell me how to get it to print from the templates $goodspot

i have put $goodspot in the template for this page but it wont get it

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 03-23-2003, 09:07 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

the eval code must be below the define of goodspot.
Reply With Quote
  #3  
Old 03-23-2003, 09:20 PM
Mickie D Mickie D is offline
 
Join Date: Jun 2002
Posts: 430
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks very much for your help could you just show how you mean i been learning php for 5 days now

i think i am learning fast, but i really could do with a bit of help thanks
Reply With Quote
  #4  
Old 03-23-2003, 09:28 PM
Mickie D Mickie D is offline
 
Join Date: Jun 2002
Posts: 430
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yes i got it to work

thanks so much

you are fantastic, thanks again i will be posting in here quite a bit so i will appologise now lol
Reply With Quote
  #5  
Old 03-23-2003, 09:45 PM
Mickie D Mickie D is offline
 
Join Date: Jun 2002
Posts: 430
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

right i am using this code below but i get the same result from my page no matter what i put in it

the result is always your town is Manchester you should try bagleys night club

here is the code

if ($Your_Town == "London" or "london") {
$goodspot = "bagleys night club";
} elseif ($Your_Town == "Manchester" or "manchester"){
$goodspot = "space consala";
}

please note i am using another page b4 this one, and it uses a html form to post the $Your_Town infomation
Reply With Quote
  #6  
Old 03-23-2003, 10:10 PM
colicab-d's Avatar
colicab-d colicab-d is offline
 
Join Date: Dec 2002
Location: Glasgow
Posts: 382
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hey what you should do is create a form with lots of values in it for (name of each town) and that way the forms name=name will be $name and you can then have it user enabled
Reply With Quote
  #7  
Old 03-23-2003, 10:14 PM
Mickie D Mickie D is offline
 
Join Date: Jun 2002
Posts: 430
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

sorry m8 that went a little over my head ... do you mean make bigger arrays ????

with all the names in one array ???
Reply With Quote
  #8  
Old 03-23-2003, 10:26 PM
colicab-d's Avatar
colicab-d colicab-d is offline
 
Join Date: Dec 2002
Location: Glasgow
Posts: 382
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yeah basically like do a mutli selection form and anyvalue set in that will then equal one $city instead of defining lots of seperate $londons , $manchester etc

you can have have (im too tired for exact code)

if $city = london {

echo "london is big";
}

else

echo "your town is poop"
Reply With Quote
  #9  
Old 03-23-2003, 10:58 PM
Mickie D Mickie D is offline
 
Join Date: Jun 2002
Posts: 430
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you cant use echo in a page that is intergrated into the forums because of the templates

but i have it sorted thanks to bane

it was my coding i had the "London" or "london" and it never understood, so bane gave me a code that stoped the matter for capitolization (if thats how you spell it lol)

working like a dream
Reply With Quote
  #10  
Old 03-24-2003, 08:03 PM
colicab-d's Avatar
colicab-d colicab-d is offline
 
Join Date: Dec 2002
Location: Glasgow
Posts: 382
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

erm yes you can ive been writing admin cp hacks and echo is working fine for me lol
Reply With Quote
Reply


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 10:52 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04148 seconds
  • Memory Usage 2,285KB
  • Queries Executed 23 (?)
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)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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