DragonPrime - LoGD Resource Community
Welcome Guest
  • Good afternoon, Guest.
    Please log in, or register.
  • January 19, 2018, 04:56:00 PM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: Adding options to php file  (Read 3007 times)
0 Members and 1 Guest are viewing this topic.
Stonedale
Guest
« on: June 23, 2004, 06:33:12 PM »

I Was woundering how you call on part of the script like in the in, it doesn't call on another php file when you talk to someone. I tried to figure it out but, all i can do is have it link to another php file like this.

addnav("Talk to  locals");
addnav("(T) Talk to the Barkeep","flint.php");

I want to beable to have it call on it in the same script and work. I've tried looking at the inn.php and copying what I seen there but, i get errors. What command do you use for this to work right.

Sorry for all the newbie questions but, they don't really tell you this kind of stuff on the php help sites lol. Well, not atleast in laymen terms.
Logged
Peanut_Butter_Wolf
Guest
« Reply #1 on: June 23, 2004, 07:47:06 PM »

little confused on exactly what you want.. But i'm assuming you just mean this..

addnav ("what you want the link to display as" ,"yourfile.php?op=flint" );

then above the portion of the script you want executed when they click the link..

if ($_GET[op]=="flint"){
your code goes here.
}

Hope that helps,
- pbw
« Last Edit: June 23, 2004, 07:50:18 PM by Peanut_Butter_Wolf » Logged
Stonedale
Guest
« Reply #2 on: June 23, 2004, 08:44:58 PM »

Thats what I was talking about thanks man. I had just figured part of it out by looking at the inn.php. But I was still a little lost lol.
Logged
Stonedale
Guest
« Reply #3 on: June 23, 2004, 09:24:18 PM »

I tried to do this but I don't get any text to show up. the navi is right as far as i know.
addnav("Talk to Locals");
addnav ("Talk to barkeep" ,"flintspub.php?op=flint" );

So I think it has to be something I am doing wrong here. I had a few error messages at frist but I fixed my mistakes. I'm nut sure why it's not showing up tho on the screen when the link is clicked. It just all blank. I've look at a few other files and don't see anything much different about the way they are set up.
if ($_GET[op]=="flint"){
output("`c<font size='+1'>`6Flint</font>`c`n",true);   
output(" You walk up to the barkeep and ask him whats the best he's got to drink.'n");
output(" He looks up at you and stops wiping down the bar. His eyes look right at yours and he says \" The Ale is good tonight\"'n");
output(" Your body starts to sweat and you grow nervous.\In a small voice you say thanks!'n");

}
Logged
Kendaer
Guest
« Reply #4 on: June 24, 2004, 07:20:19 AM »

Your code in flint's pub is most likely missing page_header() call at the top and a page_footer() call at the bottom.

*nothing* is drawn on the screen until the page_footer() call.

All the output function does is store the text in an internal buffer which is output with the page_footer().
Logged
Stonedale
Guest
« Reply #5 on: June 24, 2004, 03:03:27 PM »

Edit: no that wasn't it. I'm completely confused now lol.

Here is the file if you don't mind looking.
« Last Edit: June 24, 2004, 03:43:03 PM by Stonedale » Logged
Spider
Guest
« Reply #6 on: June 24, 2004, 04:57:16 PM »

the page_header(); should be directly after the require "common.php";

that may or may not fix it, I didn't see anything else obviously wrong though.

edit:
also, you shouldn't ever need two page_header() calls, and it's good practice to put both the include of common.php and the page_header() right at the top, before any version comments even, that way it's quite clear that it isn't a part of the code that should be changed, and you shouldn't ever have problems with them that way either.
« Last Edit: June 24, 2004, 04:59:36 PM by Spider » Logged
Stonedale
Guest
« Reply #7 on: June 24, 2004, 05:05:31 PM »

Edited: Ok I fixed the little error I was having but, after tring what you said I still get a blank page. Well sorry let me rephrase that, the page shows everything it should but, the text.
« Last Edit: June 24, 2004, 05:15:57 PM by Stonedale » Logged
Eth
Member
Codemeister
****
Offline Offline

Posts: 302


Shameless Drunk


View Profile
« Reply #8 on: June 24, 2004, 07:22:50 PM »

Thought I'd lend my hand to those in need.

This is a fairly simple fix. All that's needed is to place the navigation links in their proper place, and clean up a few errant brackets. Oh, and rename the file to flintspub as that is the file name your mod calls.

'Lest I forget, you need to include the following as well:
Code:
addcommentary();
This needs to be added in if you wish to be able to have a chat area. It's standard practice for me to place it just under the page header at the top of the file.

With that said, I tooled around with your mod a bit and got it working properly. Added in some comments that may or may not be helpful. I've attached the mod below as a txt file.
Logged

Purveyor of fine cloaks, gloves, boots, gerbils, and Siamese cats.
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Play LoGD on Dragonprime

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
20 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search