DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • May 18, 2013, 02:37:17 AM
Home Forums News Links Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
IRC Channels
Search

Pages: [1] 2 3   Go Down
  Print  
Author Topic: Working on shop and getting odd Parse error  (Read 2938 times)
0 Members and 1 Guest are viewing this topic.
Velle
Guest
« on: January 25, 2008, 02:18:04 PM »

I am working on a flower shop based on Sichea's apple shop but it is giving randome buffs instead of gems and what not.  SO far so good till I get to one section that has me a bit baffled as to why I am getting parse error.  The code looks as follows:
Quote
else{
              if ($session['user']['gold']>=$c){
                   $session['user']['gold']-=$c;
                   $et++;
                   set_module_pref("stemsallowed",$et);
                 
                   switch ($flower){
                       case "Rose":
                        output("`$The soft delicate scent of the blood red rose fill your nose as the color captures your eye.");
                        output("You reach out to grasp the stem to feel the sudden pain of a thorn pierce the soft flesh of your thumb.");
                        output("You quickly pull your hand back and suck the red drop of blood from your didget as Velle stoops to pick up the dropped flower and hand it back to you.");
                        output("\"`%Careful`$\" she says with an odd smile,\"`%The prick of the rose can have odd effects`$\`n);
                   velleshop_flower();
break;
                     
                   

                       case"Lilly":
                        output("`7Looking over your shoulder you see a tall black vase with bright white flowers that bring to mind thoughts of death and funerals");
                        output("Stepping forward you dip your head down to see if these beauties have a scent.");
                        output("Velle simply laughs as you feel the strange scent invade your mind.);
                        output("You can feelthat something has changed with in you..but what?!?");
                     velleshop_flower();

The error is showing up on the line with case"Lilly":  and it tells me:
Parse error: parse error in /Users/lynn/Sites/lotgd-1.1.0/modules/velleshop.php on line 145.  I've been looking for a missing bracket or some other syntax error but can't seem to find one.
Logged
Talisman
Administrator
Mod God
*****
Offline Offline

Posts: 5427



View Profile WWW
« Reply #1 on: January 25, 2008, 02:27:49 PM »

Your bright red colour codes ($) in the previous lines are probably causing your problems owing to PHP reading them as operators for a variable.  Precede them with \ and you should be ok.
Logged

Play the latest beta version here on DragonPrime
White Knight
Mod God
*****
Offline Offline

Posts: 1030

For the truth!


View Profile
« Reply #2 on: January 25, 2008, 02:29:57 PM »

...or put the strings into single quotes instead of double.  That way you won't have to worry about the $ or " needing a \.
Logged

Helping you help yourself.
Velle
Guest
« Reply #3 on: January 25, 2008, 02:30:35 PM »

 Roll Eyes  sadly, I knew that too.  ~slaps head and curses bad eyesight~
Logged
White Knight
Mod God
*****
Offline Offline

Posts: 1030

For the truth!


View Profile
« Reply #4 on: January 25, 2008, 02:33:37 PM »

Also, you have unclosed quotes in this line:
output("\"`%Careful`$\" she says with an odd smile,\"`%The prick of the rose can have odd effects`$\`n);
Logged

Helping you help yourself.
Velle
Guest
« Reply #5 on: January 25, 2008, 02:38:16 PM »

Yeah, all better  Grin  Thanks to both of you.. been fighting with that for far too long today ~sigh~
Logged
Velle
Guest
« Reply #6 on: January 26, 2008, 09:32:16 PM »

all the parse errors gone and it installed, but then I went to change a setting and now I can't find it in the module Manager as even listed to be activated and or installed  Huh  I swear it was there and then decided to run behind the door or something .  I attached the full file.  Darn it soooo close yet sooooo far.

****edit took off this attachment, there is a new one further down
« Last Edit: January 27, 2008, 01:41:25 PM by Velle » Logged
Oridin
Guest
« Reply #7 on: January 26, 2008, 09:35:54 PM »

It should be a php file. name it velleshop.php.
Logged
Velle
Guest
« Reply #8 on: January 26, 2008, 09:37:29 PM »

It is php in the module file of the game.  I changed it to txt so that I could attach it here.
Logged
DaveS
Mod God
*****
Offline Offline

Posts: 1544


Dfly... you know, as in DaveFly


View Profile
« Reply #9 on: January 26, 2008, 09:52:37 PM »

return $info;

needs to be INSIDE the brackets of the function velleshop_getmoduleinfo(){
Logged

Check out my Last Module:
The Dragon Eggs Expansion
http://dragonprime.net/index.php?topic=8474.0

About my Retirement:
http://dragonprime.net/index.php?topic=9080

See my complete module list here:
http://dragonprime.net/index.php?topic=3038.0
Velle
Guest
« Reply #10 on: January 27, 2008, 01:39:04 PM »

~Sigh~  Okay it installed again I must have moved cursor when changing stuff and didn't realize I'd moved bracket..or I just screwed up.  Either way tha is now fixed but I have one more mystery for ya.  Hopefully this will be the last one ~crosses fingers~  The shop installs, it shows up in village... I click the nav link and enter and wham nothing, blank white page... not even an error message so that I might have a hope of figuring out what is going on.  I am finding php to be very different from the basic I did on the ol' commador 64 I had as  a kid (man just dated myself, didn't I?)  Any hoo...have attached the re-vised code as txt file.  Guess I should go get rid of other version up top.
Logged
DaveS
Mod God
*****
Offline Offline

Posts: 1544


Dfly... you know, as in DaveFly


View Profile
« Reply #11 on: January 27, 2008, 02:13:56 PM »

Add the following right before the ?> at the very end of the module:

page_footer();
Logged

Check out my Last Module:
The Dragon Eggs Expansion
http://dragonprime.net/index.php?topic=8474.0

About my Retirement:
http://dragonprime.net/index.php?topic=9080

See my complete module list here:
http://dragonprime.net/index.php?topic=3038.0
Velle
Guest
« Reply #12 on: January 27, 2008, 06:22:00 PM »

I added that and now the install screen is a big blank box Sad(I can't eve see the other modules that are set to install, everything is greyed out)

Poor DaveS, I bet your sick of me by now.
~passes a huge choccy cake to make it better~
Thanks to you and others for help on my first module writing project.
« Last Edit: January 27, 2008, 06:29:12 PM by Velle » Logged
White Knight
Mod God
*****
Offline Offline

Posts: 1030

For the truth!


View Profile
« Reply #13 on: January 27, 2008, 08:05:32 PM »

That line of code DaveS gave you should be inside (read: preceding) the last } before ?>, not right before the ?> as he said.  It should be part of the function.
« Last Edit: January 27, 2008, 08:07:09 PM by White Knight » Logged

Helping you help yourself.
DaveS
Mod God
*****
Offline Offline

Posts: 1544


Dfly... you know, as in DaveFly


View Profile
« Reply #14 on: January 27, 2008, 10:51:00 PM »

Yeah... white knight is right.  I didn't look at the function you had in the code.

So here's your module... it runs on my test server.  You may have to fix some of the colors and I didn't really playtest it that much.  Good luck!
Logged

Check out my Last Module:
The Dragon Eggs Expansion
http://dragonprime.net/index.php?topic=8474.0

About my Retirement:
http://dragonprime.net/index.php?topic=9080

See my complete module list here:
http://dragonprime.net/index.php?topic=3038.0
Pages: [1] 2 3   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Welcome to DragonPrime - The LoGD Resource Community!

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