*

Recent

Author Topic: Editing Games on the fly  (Read 14347 times)

Frank

  • Sr. Member
  • ****
  • Posts: 257
  • Force: +4/-0
Re: Editing Games on the fly
« Reply #15 on: October 17, 2011, 04:11:06 PM »
Sorry Adam,

I don't mean to confuse anyone. ;)

But if I was to use $domain = ozigames.net/arcade/

Then the script below would become a problem.

$directorypath would be left empty, but then I would end up with:

ozigames,net/arcade//

And where the $directorypath is used without the $domain I would end up with:

Nothing?

Yep! Confusing to say the least. But as I assumed that FAS was a work in progress, I also assumed that some things had been overlooked, or put on the To-Do list - That's why I went through adding globals and setting both $domain and $directorypath everywhere a full path was missing.

I'm no expert, but imho it's the correct way to do it.  ???

Anyway, it can't be both ways where sometimes it uses $directorypath and mostly it doesn't - Particularly if one is going to "modify" the $domain.

Code: [Select]
Line 36: <meta http-equiv="REFRESH" content="0;url=$domain'.'$directorypath">
Line 41: $url = ''.$domain.'/'.$directorypath.'/login/';
Line 43: $url = ''.$domain.'/'.$directorypath.'/index.php?action=login';
Line 35: echo '<meta http-equiv="REFRESH" content="0;url='.$domain.'/'.$directorypath.'">';
Line 51: $url = ''.$domain.'/'.$directorypath.'/login/';
Line 53: $url = ''.$domain.'/'.$directorypath.'/index.php?action=login';
Total Hits: <?php include ("$directorypath/includes/counter.php"); ?><br />
Line 55: $target = $directorypath."avatars/";
Line 230:                               Total Hits: <?php include ("$directorypath/includes/counter.php"); ?><br />

Line 36: <meta http-equiv="REFRESH" content="0;url=$domain'.'$directorypath">
Line 41: $url = ''.$domain.'/'.$directorypath.'/login/';
Line 43: $url = ''.$domain.'/'.$directorypath.'/index.php?action=login';
Line 51: $url = ''.$domain.'/'.$directorypath.'/login/';
Line 53: $url = ''.$domain.'/'.$directorypath.'/index.php?action=login';
Line 59:                               Total Hits: <?php include ("$directorypath/includes/counter.php"); ?><br />
Line 55: $target = $directorypath."avatars/";
Line 230:                               Total Hits: <?php include ("$directorypath/includes/counter.php"); ?><br />

Maybe a var something like $fullsitepath = $domain/$directorypath/ and change $domain to $fullsitepath

That's pretty commonly used.

Dunno? :P
« Last Edit: October 17, 2011, 04:18:24 PM by mort »

Adam LaCombe

  • Sr. Member
  • ****
  • Posts: 433
  • Force: +17/-0
    • My Blog
Re: Editing Games on the fly
« Reply #16 on: October 17, 2011, 08:30:46 PM »
But.. like I said $domain needs to be http://ozigames.net/arcade

$directorypath needs to start in the root of your server. So in a linux server it would be.. /var/www/your_website_directory/arcade

So you have apache.. apache is set up for your arcade website ozigames k?
So on godaddy or w/e you use your domain gets forwarded to your ip then your server reads it and decides which directory to display.
So apache uses that same $directorypath value to display your website.

Long story short.. urls contain a domain, a path, and queries. Directory path contains the path to where your website files are stored.
When you include(); you want to use the directory path to tell it where to find your file you wanna include.

So $directorypath is: /var/www/your_website_directory/arcade
and $domain is: http://ozigames.net/arcade

Ya understand a little better?
My explanations aint too good, I know lol but if that doesn't make sense lemme know

Frank

  • Sr. Member
  • ****
  • Posts: 257
  • Force: +4/-0
Re: Editing Games on the fly
« Reply #17 on: October 18, 2011, 01:18:02 AM »
I must have got spoiled writing and porting stuff for phpBB?

http:// isn't part of the DNS - it's only the protocol.

How I see it is this:

'.$domain.'/ = DNS/

http://DNS/directory/etc

So we end up with.

http://$domain/directory

And here we're using (Or not Using):

http://$domain/$directory/ to parse both the "Site Path" and directory paths  to and from the Db.

Maybe they taught me the wrong way - Because I always believed that when one is four folder levels down, then the use of vars like $templatepath or $domain/$directory/ is a whole lot better than the UNIX path which would end up something like: ./../../../../?

Or something like this: $templatepath = $domain/$directorypath/templates/$template/

It's a lot easier.

Now I'm out of this thread - Seeing that it's gone off-topic! ROFL!!
« Last Edit: October 18, 2011, 01:19:34 AM by mort »

Adam LaCombe

  • Sr. Member
  • ****
  • Posts: 433
  • Force: +17/-0
    • My Blog
Re: Editing Games on the fly
« Reply #18 on: October 18, 2011, 05:51:12 AM »
lol yes you are correct. But.. the $directorypath is not to be used for what you wanna be using it for...
As I said it needs to be used mostly for when we include files.
$domain contains the path to your arcade  ;)

Frank

  • Sr. Member
  • ****
  • Posts: 257
  • Force: +4/-0
Re: Editing Games on the fly
« Reply #19 on: October 18, 2011, 08:45:28 AM »
Yes, I think we've been looking at it with two different concepts. ;)

But if I wanted to make a CONSTANT out of this string - Maybe {THEME} There wouldn't be any room to change it afterwards.  ;D

Code: [Select]
$domain/$directorypath/$themes/$template/
Catcha' Later - - -

Dillon

  • Developer
  • Sr. Member
  • ******
  • Posts: 340
  • Force: +3/-0
    • Arcade Freak
Re: Editing Games on the fly
« Reply #20 on: October 31, 2011, 06:42:57 PM »
Well i got board so i decided to post the fully working code for a non edited FAS script.

Code: [Select]
Sample one. with $in

';
if($usrdata['user_level'] == 2){
echo '
<div style="float: right; vertical-align: top; padding-right: 20px;">
<a href=\''.$domain.'/index.php?action=admin&amp;case=managegames&amp;cmd=edit&amp;ID='.$in[ID].'&amp;type='.$in[type].'\' onclick="return confirm(\'Are you sure you want to edit the game '.$in['name'].'?\')"><img src=\''.$domain.'/templates/'.$template.'/images/editbtn.png\' title=\'edit game\' alt=\'edit game\' border=\'0\' /></a>
<a href=\''.$domain.'/index.php?action=admin&amp;case=managegames&amp;cmd=delete&amp;ID='.$in[ID].'\' onclick="return confirm(\'Are you sure you want to delete the game '.$in['name'].'?\')"><img src=\''.$domain.'/templates/'.$template.'/images/deletebtn.png\' title=\'delete game\' alt=\'delete game\' border=\'0\' /></a></div>';
}

echo '


____________________________________________________

Sample 2. with $row

';
if($usrdata['user_level'] == 2){
echo '
<div style="float: right; vertical-align: top; padding-right: 20px;">
<a href=\''.$domain.'/index.php?action=admin&amp;case=managegames&amp;cmd=edit&amp;ID='.$row[ID].'&amp;type='.$row[type].'\' onclick="return confirm(\'Are you sure you want to edit the game '.$row['name'].'?\')"><img src=\''.$domain.'/templates/'.$template.'/images/editbtn.png\' title=\'edit game\' alt=\'edit game\' border=\'0\' /></a>
<a href=\''.$domain.'/index.php?action=admin&amp;case=managegames&amp;cmd=delete&amp;ID='.$row[ID].'\' onclick="return confirm(\'Are you sure you want to delete the game '.$row['name'].'?\')"><img src=\''.$domain.'/templates/'.$template.'/images/deletebtn.png\' title=\'delete game\' alt=\'delete game\' border=\'0\' /></a></div>';
}
echo '

___________________________________________________

Play.php

';
if($usrdata['user_level'] == 2){
echo '
<div style="float: right; vertical-align: top; padding-right: 20px;">
<a href=\''.$domain.'/index.php?action=admin&amp;case=managegames&amp;cmd=edit&amp;ID='.$r[ID].'&amp;type='.$r[type].'\' onclick="return confirm(\'Are you sure you want to edit the game '.$r['name'].'?\')"><img src=\''.$domain.'/templates/'.$template.'/images/editbtn.png\' title=\'edit game\' alt=\'edit game\' border=\'0\' /></a>
<a href=\''.$domain.'/index.php?action=admin&amp;case=managegames&amp;cmd=delete&amp;ID='.$r[ID].'\' onclick="return confirm(\'Are you sure you want to delete the game '.$r['name'].'?\')"><img src=\''.$domain.'/templates/'.$template.'/images/icons/deletebtn.png\' title=\'delete game\' alt=\'delete game\' border=\'0\' /></a></div><br />
'.$r['description'].'
';
}
echo '

Frank

  • Sr. Member
  • ****
  • Posts: 257
  • Force: +4/-0
Re: Editing Games on the fly
« Reply #21 on: October 31, 2011, 06:50:28 PM »
If you're that bored, then why don't you work on something like this.

http://ozigames.net/test/index.php?action=blogentry&entryid=1

About 500 edits, and a lot of moving stuff around - An no, it's not compatible with the default FAS theme - And No I'm not going to make it so that it is either.

It's also not finished - - :P

Dillon

  • Developer
  • Sr. Member
  • ******
  • Posts: 340
  • Force: +3/-0
    • Arcade Freak
Re: Editing Games on the fly
« Reply #22 on: October 31, 2011, 07:12:05 PM »
but.... i am working on that.... lol just not as far as you