Using FAF as a backend

You can talk about anything here, not necessarily game-related. You may also advertise here.
User avatar
windhound
Fish Rocketh, cows sucketh
Posts: 1030
Joined: Wed Jun 02, 2004 4:36 pm
Location: Ze Ocean

Post by windhound »

this probably could go in the devel. section, but eh.
I've got several reasons for attempting this
the primary is that my php and mysql knowledge is minimum at best and I wanted a base
the old version of the website is static and I have to manually update it myself. the goal here is to make a website that others with very limited knowledge of computers could update
pondered using a wiki, but somehow FAF seems more logically setup and properly skinning some of those wikis can be downright icky. also thinking of using a form-based submission for the events page, and that couldnt happen with a standard wiki
plus, its kinda fun

for refrence, old site:
http://mahahounds.org

First big question, as I'm sure you can see the login section is still visible. I found how to hide it:
http://smarty.php.net/manual/en/languag ... ection.php at the bottom there is the 'show' option
in login.php I have inserted:

code: Select all

$uri = urldecode($_SERVER['REQUEST_URI']);
$action = substr($uri,strpos($uri,'?')+1);
if ($action == "login") {
	$showlogin = TRUE;	}	
//	print "true";}
else {
	$showlogin = FALSE;	}	
//	print "false";}
and in login.html

code: Select all

{section name=login loop=$servers }//show=$showlogin}
for now because if I put in

code: Select all

{section name=login loop=$servers show=$showlogin}
it takes the box away and wont give it back, even for ?login

the idea is if I or anyone else wanted to login they would type http://blackbirdfly.no-ip.org/maha/index.php?login and magically the box would appear..
it seems to properly decide if it wants to give $showlogin true or false, but it doesnt seem to take it over to login.html like I would like it to

I'm halfway decent with java, but know very little php or smarty tags

and no, most of the sidebar links dont point to their proper places yet.. I'll fix them as I get to them

if this works that would be great, as I could give the people who need it one login, they could go edit what they need to and not have to wait on me.. I'm sure there are easier ways, but yeah
Hobbs FTW!
User avatar
The Beatles
Fear me for I am root
Posts: 6285
Joined: Tue May 24, 2005 8:12 pm

Post by The Beatles »

You need:
$tpl->assign('showlogin', $showlogin);

:)

$action is always going to be 'login' if you are in 'login.php', by the way, so I am not really sure what you are trying to achieve. But as for your question of making the variable usable in the template, yes, the above line will cause that.

And of course I'm flattered you're using FAF! :D
:wq
User avatar
windhound
Fish Rocketh, cows sucketh
Posts: 1030
Joined: Wed Jun 02, 2004 4:36 pm
Location: Ze Ocean

Post by windhound »

hah, awesome
http://blackbirdfly.no-ip.org/maha/
http://blackbirdfly.no-ip.org/maha/?login

hides the login box till I need it

thanks beatles!
Hobbs FTW!
User avatar
Slasher
The FAF Forums SMEGHEAD!!! lol
Posts: 2635
Joined: Mon May 03, 2004 5:08 pm
Location: http://florida4us.com/
Contact:

Post by Slasher »

Haha thats a cool idea
I do not have a signature, you must be imagining

http://florida4us.com/

Image
User avatar
windhound
Fish Rocketh, cows sucketh
Posts: 1030
Joined: Wed Jun 02, 2004 4:36 pm
Location: Ze Ocean

Post by windhound »

thanks slasher :)

woo
after much trial and a metric ton of error I've just about got it done
the event and news page are run via faf
news is just a hacked down 'profile' page, of the admin no less
event list is the scores page, and the 'events' are little users.. which are all, oddly, dead or disabled, so I dont have to worry about somone trying to log in with them.. an unintentional feature ;) [not that anyone should beable to do anything even if they logged in, the menu is altered as well]
it seems to be all working properly, I've set it up so that events older than today's date get marked as dead-er, and it sorts by date as well. No edit function (yet), but I left in the user control panel so they can just mark events as disabled and make a new one.

oh, 'where' doesnt work yet because I took over its column to check date formatting.. will fix that ina bit


The rest of the pages are ewiki
for now I'm putting in images using html tags till beatles figgures out whats wrong with the thing
Hobbs FTW!
User avatar
The Beatles
Fear me for I am root
Posts: 6285
Joined: Tue May 24, 2005 8:12 pm

Post by The Beatles »

Very cool. :D

I'll look at the bugs you mentioned over the weekend.
:wq
User avatar
windhound
Fish Rocketh, cows sucketh
Posts: 1030
Joined: Wed Jun 02, 2004 4:36 pm
Location: Ze Ocean

Post by windhound »

also, do you know how to get the sidebar to go all the way to the bottom? or atleast appy the background to that last bit.. its not noticable on pages longer than the screen, but on short pages like forms it looks a little odd.

if :blink: was at the bottom of the menu when you saw it I was workin' with the page and some things went rather off ;) I've reset about everything, other than getting the sidebar to the bottom (and removing blink) that should be about it
Hobbs FTW!
User avatar
Devari
Mr. -1
Posts: 3194
Joined: Wed Mar 10, 2004 5:02 am
Location: British Columbia, Canada

Post by Devari »

Glad to see an American using the proper system of measurement, metric! Still, you might be better to say "tonne" instead.
If you go down to the woods today, you better not go alone
It's a lovely day in the woods today, but safer to stay at home
BECAUSE EVIL FREEN IS KILLING ALL THE TEDDY BEARS AT THEIR PICNIC
Turock
Forum Maniac
Posts: 289
Joined: Sat Jan 07, 2006 12:45 am
Contact:

Post by Turock »

That looks really cool! Nice job!
User avatar
The Beatles
Fear me for I am root
Posts: 6285
Joined: Tue May 24, 2005 8:12 pm

Post by The Beatles »

The American spelling is ton. Americans have adopted the metric system without adopting English spelling before. Meter, ton, gram (vs metre, tonne, gramme).
:wq
User avatar
bjornredtail
Warbands Admin
Posts: 821
Joined: Tue Apr 20, 2004 12:07 am
Contact:

Post by bjornredtail »

Humm... I always thought a ton was 2000 lbs...
0===)=B=j=o=r=n==R=e=d=t=a=i=l==>
Warbands Admin

"Program testing can be used to show the presence of bugs, but never to show their absence!"-Edsger W. Dijkstra
User avatar
Freenhult
13th Division Captain
Posts: 3380
Joined: Mon Jan 02, 2006 2:30 am
Location: Valparaiso
Contact:

Post by Freenhult »

Yeah... Its around there.
Nami kotogotoku, waga tate to nare. Ikazuchi kotogotoku, waga yaiba to nare. Sōgyo no Kotowari!

波悉く我が盾となれ雷悉く我が刃となれ,双魚の理 !

Every wave be my shield, every lightning become my blade!
User avatar
windhound
Fish Rocketh, cows sucketh
Posts: 1030
Joined: Wed Jun 02, 2004 4:36 pm
Location: Ze Ocean

Post by windhound »

Conversions

One [metric] tonne is equivalent to:

    * 1 megagram (exactly). Symbol Mg. This is the SI term
    * 1000/0.45359237 pounds (exactly) ~ 2205 pounds (by comparison the imperial measurements long ton and short ton are 2240 and 2000 pounds, respectively)
I said metric ton because I knew it was slightly heavier than the standard ton, but I didnt realize there was also a long ton :blink:
Hobbs FTW!
Turock
Forum Maniac
Posts: 289
Joined: Sat Jan 07, 2006 12:45 am
Contact:

Post by Turock »

Never knew of long ton vs short ton before. I was always under the impression that a ton was 2,000 lbs.
User avatar
windhound
Fish Rocketh, cows sucketh
Posts: 1030
Joined: Wed Jun 02, 2004 4:36 pm
Location: Ze Ocean

Post by windhound »

btw, I actually do need help extending that sidebar.. I looked at the site on my laptop and it looks a little crappy without the sidebar going all the way down
I cannot figgure out how to get the thing to go down, except set a fixxed length in px, but thats not much help as everyone has different resolutions
Hobbs FTW!
Post Reply
  • Members connected in real time

    🔒 Close the panel of connected members