Challenge Add New Page

phpBB3 and MOD challenges setup by the staff to test and challenge your phpBB3 coding skills.

Challenge Add New Page

Postby Sniper_E » 14 Jun 2008, 04:39

I have never added a new page in the forums. This is a challenge for myself.
Not counting the table less template. I know I failed there.

I put this together flying by the seat of my pants.
Could you maybe look at it on your local and tell me how I did?

Add these codes in your overall_header.html
Spoiler:
Paste these codes between the <head> </head> tags.
Code: Select all
<script type="text/javascript">
<!--
   var 
reloadInterval 60;
   var 
reloadCounter 1;
   var 
doCountdown 0;

   
doCountdown 1;
   function 
runclock()
   {
      
reloadCounter reloadCounter 1;
           
      if (
doCountdown)
         
document.getElementById('counter').clock.value reloadCounter;
           
      if (
reloadCounter 1)
         
reload();
           
      
timerID setTimeout("runclock()"1000);
   }
         
   function 
reload()
   {
      var 
now = new Date();
      var 
camimage0 document.camimage0.src;
      var 
splitIndex camimage0.indexOf("?");
           
      if (
splitIndex > -1)
         
camimage0 camimage0.substring(0splitIndex);

      
document.camimage0.src camimage0 "?" now.getTime();
      
reloadCounter reloadInterval;
   }
//-->
</script>

Add the onload= code inside the <body> tag.
Code: Select all
<body onload="runclock()">    
And then copy these file to your server.
Attachments
webcam.zip
(6.54 KiB) Downloaded 113 times
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!
User avatar
Sniper_E    
STG Jedi Master
STG Jedi Master
 
Posts: 7004
Joined: 31 May 2006, 06:29
Location: Shreveport, LA
Favorite Team: The STG Team
Gender: Male
phpBB Knowledge: 6


Re: Challenge Add New Page

Postby topdown » 14 Jun 2008, 10:33

Error
Fatal error: Call to undefined function activity_mod() in W:\project\webcam.php on line 116

Just kidding :lol: I don't have the activity mod on my local :rotfl:

Nice work sniper !

I think they are going to want the language file in the mods directory though.
$user->setup('mods/webcam');

<div align="center"> thats a no no in a prosilver style because it's not valid for XHTML strict

either use inline CSS style="text-align: center;"
or set up a class for it.
Do not PM me for Support unless I give permission in a post......PM's only help one, posts help everyone !
User avatar
topdown    
STG Styles Leader
STG Styles Leader
 
Posts: 3031
Joined: 01 Oct 2007, 22:56
Location: Handyman's harddrive
Favorite Team: STG Teams
Gender: Male
phpBB Knowledge: 9

Re: Challenge Add New Page

Postby Sniper_E » 14 Jun 2008, 12:50

Then that activity_mod(); line on line 116 can come out, right?

And that prosilver page could use some of your handy work. style="text-align: center;" sounds better than adding a class.
It would be better to use the classes prosilver already has than adding classes. Would you do that page topdown?

The chat uses $user->setup('chat'); so I used $user->setup('webcam'); for this. That should be OK. What you say Francis?
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!
User avatar
Sniper_E    
STG Jedi Master
STG Jedi Master
 
Posts: 7004
Joined: 31 May 2006, 06:29
Location: Shreveport, LA
Favorite Team: The STG Team
Gender: Male
phpBB Knowledge: 6

Re: Challenge Add New Page

Postby topdown » 14 Jun 2008, 14:11

I'll go through it a little later today, I have some things I need to go do first.
Do not PM me for Support unless I give permission in a post......PM's only help one, posts help everyone !
User avatar
topdown    
STG Styles Leader
STG Styles Leader
 
Posts: 3031
Joined: 01 Oct 2007, 22:56
Location: Handyman's harddrive
Favorite Team: STG Teams
Gender: Male
phpBB Knowledge: 9

Re: Challenge Add New Page

Postby Sniper_E » 14 Jun 2008, 16:21

OK, webcam.zip has been updated on the first post.

subsilver2 validation is good.
I just don't know what to do with prosilver.
It's down to 1 error which does not show up in subsilver2's validation. Strange....
They both use the same codes which shows that error in prosilver.
topdown, that's some of your work in here too, hmmmm, maybe it's you! :P

My challenge was adding a page in phpBB3 with all it's parts needed. I guess I did OK.
Did I over do it somewhere? Did I not take all the correct steps?
Actually, I should have posted this in here: viewtopic.php?p=4479#p4479
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!
User avatar
Sniper_E    
STG Jedi Master
STG Jedi Master
 
Posts: 7004
Joined: 31 May 2006, 06:29
Location: Shreveport, LA
Favorite Team: The STG Team
Gender: Male
phpBB Knowledge: 6

Re: Challenge Add New Page

Postby CoC » 14 Jun 2008, 16:57

In your language file replace,
Code: Select all
name="camimage0"

with,
Code: Select all
id="camimage0"


The name attribute is not valid xhtml strict.

It will validate in prosilver once that is done - :good:
User avatar
CoC    
MOD Author
MOD Author
 
Posts: 490
Joined: 23 Jan 2007, 11:09
Location: Coventry
Favorite Team: Coventry City
Gender: Male
phpBB Knowledge: 8

Re: Challenge Add New Page

Postby Sniper_E » 14 Jun 2008, 17:04

Cool, I'll try that. That is part of the timer script in the header so I'll try to change them all together.
Actually, I wish I could put that timer script in the ./webcam.php file. But.... one thing at a time.

:yahoo: Did it, validated it and the mouseover still works. It's all good in the validation area now! Thanks CoC!
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!
User avatar
Sniper_E    
STG Jedi Master
STG Jedi Master
 
Posts: 7004
Joined: 31 May 2006, 06:29
Location: Shreveport, LA
Favorite Team: The STG Team
Gender: Male
phpBB Knowledge: 6

Re: Challenge Add New Page

Postby topdown » 14 Jun 2008, 17:17

Try to blame it on me :club: my code had id's :rotfl: thats one of the things I converted for prosilver validation

Glad to see you got it worked out though :thumbsup:
Do not PM me for Support unless I give permission in a post......PM's only help one, posts help everyone !
User avatar
topdown    
STG Styles Leader
STG Styles Leader
 
Posts: 3031
Joined: 01 Oct 2007, 22:56
Location: Handyman's harddrive
Favorite Team: STG Teams
Gender: Male
phpBB Knowledge: 9

Re: Challenge Add New Page

Postby CoC » 15 Jun 2008, 12:30

No problem buddy - :good:
User avatar
CoC    
MOD Author
MOD Author
 
Posts: 490
Joined: 23 Jan 2007, 11:09
Location: Coventry
Favorite Team: Coventry City
Gender: Male
phpBB Knowledge: 8


Return to phpBB3 Challenges at phpBB Academy

Who is online

Users browsing this forum: No registered users and 1 guest