[RELEASE] Rough Homepage Template. (No XML)

02/02/2017 22:33 .Nexitis#1
Hey, i've been bored so i made a little template for anyone who wants to use it.

It's not special and i've kept the design very simple so you can adjust it to your theme.

I also tried to keep it modular, so if you add a new page you can use php to include the modules.

e.g:
PHP Code:
<?php include "data.php" ?>
currently available modules:
PHP Code:
<?php include "head.php" //links
include "nav.php"//navigation
include "jumbotron/jumbotron.php"//...jumbotron.. obviously
include "status.php"// insert your own statuscheck script if needed
include "art.php"//posts
include "footer.php" //footer 
include "regi.php" //register
?>
There currently is a link to a registration page where i used [Only registered and activated users can see links. Click Here To Register...]. You may adjust it to your needs or use another code. Also: i recommend to type the credentials into a seperate ".ini" file and include them from there. Its safer.


If you want your own Disqus Channel then follow this [Only registered and activated users can see links. Click Here To Register...] and exchange the scripts.



Pics:

[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
02/03/2017 01:48 悪地城#2
Some people will need it.

thx for the rls.
02/03/2017 12:14 #Metho#3
Nice geste.

Two words to your code ...
PHP Code:
<?php

$usr   
$_POST['username'];
$pass  $_POST['password'];
$endPw $md5_key $pass;
$md5   md5($endPw);

$results mssql_query("SELECT * FROM dbo.Accounts WHERE '$usr' LIKE login_name");
$res     mssql_num_rows($results);

if (
strlen($usr) > && strlen($pass) > 4) {
    if (
$res 0) {
        echo 
"This account already exists.";
    } else {
        
mssql_query("INSERT INTO dbo.Accounts(login_name,password,block,withdraw_remain_time,age,auth_ok,pcbang,last_login_server_idx,event_code,result) VALUES('$usr','$md5',0,0,18,1,1,1,0,1)");
        echo 
"Registration Success !";
    }
} else {
    echo 
"Your Username or Password is too small.";
}

?>
Instead of using mssql use sqlsrv's prepare/execute functions.

PHP Code:
sqlsrv_prepare();
sqlsrv_execute(); // etc. pp. 
And do not use SELECT * ... or LIKE ... in this case. Select what you're looking for, use LIMIT xy.

Code:
SELECT myRow1, myRow2, myRow3 FROM myTable WHERE login_name = ? LIMIT 1;
And your if-else tree makes no sense.

And ...:

PHP Code:
s.setAttribute('data-timestamp', new Date()); 
To a dataset you've access with the dataset-object

PHP Code:
s.dataset.timestamp = (new Date()).toString(); 
I know a lot of this is written by Strean and that's maybe not the right section, but you're doing it public again. So you've to adjust his code at least.

edit:

Quote:
Originally Posted by 悪地城 View Post
Some people will need it.

thx for the rls.
Wieso schreibst du unter allem und jenem einen sinnlosen Beitrag?
02/03/2017 16:35 MaxChri#4
The basic website looks very nice and clean.
I would prefere it to use it for other projects. ;)

Gute Verbesserungsvorschläge, @[Only registered and activated users can see links. Click Here To Register...].
Wird ihm sicher helfen. :)
02/04/2017 00:08 .Nexitis#5
Quote:
Originally Posted by MaxChri View Post
The basic website looks very nice and clean.
I would prefere it to use it for other projects. ;)

Gute Verbesserungsvorschläge, @[Only registered and activated users can see links. Click Here To Register...].
Wird ihm sicher helfen. :)
Danke ;)

Quote:
Originally Posted by #Metho View Post
Nice geste.
Nur das Regiscript ist von Strean da ich noch keine Erfahrung darin gesammelt habe. Danke für deine Tipps! Ich werde sie beachten falls ich mich an mein erstes Script ranwage.

Die Homepage war erst für Rappelz gedacht aber da ich in letzter Zeit auch in Metin2 unterwegs bin dachte ich es könnte hier auch gebraucht werden :)
02/05/2017 16:37 kangar00#6
Quote:
Originally Posted by #Metho View Post
Nice geste.

Two words to your code ...
PHP Code:
<?php

$usr   
$_POST['username'];
$pass  $_POST['password'];
$endPw $md5_key $pass;
$md5   md5($endPw);

$results mssql_query("SELECT * FROM dbo.Accounts WHERE '$usr' LIKE login_name");
$res     mssql_num_rows($results);

if (
strlen($usr) > && strlen($pass) > 4) {
    if (
$res 0) {
        echo 
"This account already exists.";
    } else {
        
mssql_query("INSERT INTO dbo.Accounts(login_name,password,block,withdraw_remain_time,age,auth_ok,pcbang,last_login_server_idx,event_code,result) VALUES('$usr','$md5',0,0,18,1,1,1,0,1)");
        echo 
"Registration Success !";
    }
} else {
    echo 
"Your Username or Password is too small.";
}

?>
Instead of using mssql use sqlsrv's prepare/execute functions.

PHP Code:
sqlsrv_prepare();
sqlsrv_execute(); // etc. pp. 
Or use PDO, that´s what I prefer:
[Only registered and activated users can see links. Click Here To Register...]
02/05/2017 18:47 #Metho#7
Quote:
Originally Posted by ?#`/ View Post
Or use PDO, that´s what I prefer:
[Only registered and activated users can see links. Click Here To Register...]
Ja PDO ist ab den neuen Änderungen hinsichtlich fast jeder Datenbank sogar schneller und hat das beste Klassenmodell.

Kommt halt ganz auf die native prepared statements / emulated prepared statements an, aber generell ist auch PDO OOP OOD für Änfanger leichter als diese prodezuralen Lösungen. Ich wäre damals echt froh gewesen, hätte mir jemand den Tipp genannt, ... dann hätte damit angefangen statt mit mysql_* :rolleyes: