Demo

Probiere ClanSphere aus und teste daran herum. Demo


Antworten: 16
Seite [1]
Koffein


Going for pro




Beiträge: 536
# Thema - 22.07.2011 um 14:18 Uhr
Hallo,
wie man verschiedene .htm Dateien für einzelne Module benutzt weiß ich mittlerweile.
Ich würde gerne aber für eine statistische Seite eine andere .htm benutzten...

Lässt sich die index.php im Hauptverzeichnis so umbauen, dass sie die ID der statistischen Seite abfragt und bei der entsprechenden ID auf die static.htm umstellt?

index.php +-

 
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
1. / 2. / ... 
<?php
// ClanSphere 2010 - www.clansphere.net
// $Id$
if(!empty($_GET['params'])){
    
$params explode('/'$_GET['params']);
    
$file =  empty($params[1]) ? '' $params[1];
}else
    
$file $_GET['mod'];
  
if(
$file == 'board')
    
$htm_file 'board.htm';
  
//elseif($file == 'gallery')
  //  $htm_file = 'gallery.htm';

else 
    
$htm_file 'index.htm';

$cs_main = array('init_sql' => true'init_tpl' => true'tpl_file' => $htm_file);

require_once 
'system/core/functions.php';

cs_init($cs_main);


Ich kenn mich leider nicht genug mit php aus um die Abfrage da selbst reinzubauen...
Hat jemand eine Idee/Lösung?
Inaktiv
Koffein
Thread-Ersteller


Going for pro




Beiträge: 536
# Antwort: 1 - 24.07.2011 um 19:10 Uhr
Ich hab jetzt mal folgendes versucht:
 
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
1. / 2. / ... 
<?php
// ClanSphere 2010 - www.clansphere.net
// $Id$
if(!empty($_GET['params'])){
    
$params explode('/'$_GET['params']);
    
$file =  empty($params[1]) ? '' $params[1];
}else
    
$file $_GET['mod'];
    
$id $_GET['static_id'];

if(
$file == 'board')
    
$htm_file 'board.htm';
  
elseif(
$file == 'static' AND $id == '2')
 
$htm_file 'static.htm';
 
else 
    
$htm_file 'index.htm';

$cs_main = array('init_sql' => true'init_tpl' => true'tpl_file' => $htm_file);

require_once 
'system/core/functions.php';

cs_init($cs_main);


Das geht aber nicht, wahrscheinlich weil $id = $_GET['static_id']; nicht in der functions.php festgelegt ist, oder ist meine Struktur schon falsch?


Inaktiv
|
Jam2 ClanSphere Team


Highlander





Beiträge: 3291
# Antwort: 2 - 24.07.2011 um 19:30 Uhr
 
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
1. / 2. / ... 
<?php
// ClanSphere 2010 - www.clansphere.net
// $Id$
if(!empty($_GET['params'])){
    
$params explode('/'$_GET['params']);
    
$file =  empty($params[1]) ? '' $params[1];
}else
    
$file $_GET['mod'];
  
if(
$file == 'board')
    
$htm_file 'board.htm';
 elseif(
$file == 'static' AND $_GET['id'] == 3)
    
$htm_file 'static_id_3.htm';

//elseif($file == 'gallery')
  //  $htm_file = 'gallery.htm';

else 
    
$htm_file 'index.htm';

$cs_main = array('init_sql' => true'init_tpl' => true'tpl_file' => $htm_file);

require_once 
'system/core/functions.php';

cs_init($cs_main);

funktioniert aber nicht mit mod_rewrite


------------------
Gruß/ Best regards
Jam2

Nützliche Forumbeiträge/Codepastes: (Useful comments in our board / codepastes)
Template Switch for index.php
Board Navlist last posts

Edi: könnte man denn auch hier eine erweiterung einfügen?
Jam2: das web ist wie toyota.....
Edi: hö ?
Jam2: nichts ist unmöglich!


Offline
|
Koffein
Thread-Ersteller


Going for pro




Beiträge: 536
# Antwort: 3 - 24.07.2011 um 19:32 Uhr
Danke Jam,
und jetzt noch eine Lösung mit mod_rewrite,
dann bin ich wunschlos glücklich


Inaktiv
|
Jam2 ClanSphere Team


Highlander





Beiträge: 3291
# Antwort: 4 - 24.07.2011 um 19:39 Uhr
 
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
1. / 2. / ... 
<?php
// ClanSphere 2010 - www.clansphere.net
// $Id$
if(!empty($_GET['params'])){
    
$params explode('/'$_GET['params']);
    
$file =  empty($params[1]) ? '' $params[1];
    
$id =  empty($params[5]) ? '' $params[5];
}else{
    
$file $_GET['mod'];
    
$id $_GET['id'];
    
}
if(
$file == 'board')
    
$htm_file 'board.htm';
 elseif(
$file == 'static' AND $id == 3)
    
$htm_file 'static_id_3.htm';

//elseif($file == 'gallery')
  //  $htm_file = 'gallery.htm';

else 
    
$htm_file 'index.htm';

$cs_main = array('init_sql' => true'init_tpl' => true'tpl_file' => $htm_file);

require_once 
'system/core/functions.php';

cs_init($cs_main);

wird aber nur für urls funktionieren, an denen (bei mod_rewrite) die id an 5. stelle steht. sollte aber eig immer der fall sein bsp.
bsp /support/static/view/id/10


------------------
Gruß/ Best regards
Jam2

Nützliche Forumbeiträge/Codepastes: (Useful comments in our board / codepastes)
Template Switch for index.php
Board Navlist last posts

Edi: könnte man denn auch hier eine erweiterung einfügen?
Jam2: das web ist wie toyota.....
Edi: hö ?
Jam2: nichts ist unmöglich!


Offline
|
Koffein
Thread-Ersteller


Going for pro




Beiträge: 536
# Antwort: 5 - 24.07.2011 um 19:47 Uhr
Hm also irgendwie funktioniert das bei mir nicht...

index.php +-
 
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
1. / 2. / ... 
<?php
// ClanSphere 2010 - www.clansphere.net
// $Id$
if(!empty($_GET['params'])){
    
$params explode('/'$_GET['params']);
    
$file =  empty($params[1]) ? '' $params[1];
    
$id =  empty($params[5]) ? '' $params[5];
}else{
    
$file $_GET['mod'];
    
$id $_GET['id'];
    
}
if(
$file == 'board')
    
$htm_file 'board.htm';
    
 elseif(
$file == 'static' AND $id == 2)
    
$htm_file 'static.htm';

//elseif($file == 'gallery')
  //  $htm_file = 'gallery.htm';

else 
    
$htm_file 'index.htm';

$cs_main = array('init_sql' => true'init_tpl' => true'tpl_file' => $htm_file);

require_once 
'system/core/functions.php';

cs_init($cs_main);


http://test.counterstrikekingz.de/index/static/view/id/2

Somit ist die Id doch an 5ter Stelle oder nicht?


Inaktiv
|
Jam2 ClanSphere Team


Highlander





Beiträge: 3291
# Antwort: 6 - 24.07.2011 um 19:59 Uhr
Witzig, der Testlauf-Text

edit:
$id = empty($params[5]) ? '' : $params[5];
zu

$id = empty($params[6]) ? '' : $params[6];


------------------
Gruß/ Best regards
Jam2

Nützliche Forumbeiträge/Codepastes: (Useful comments in our board / codepastes)
Template Switch for index.php
Board Navlist last posts

Edi: könnte man denn auch hier eine erweiterung einfügen?
Jam2: das web ist wie toyota.....
Edi: hö ?
Jam2: nichts ist unmöglich!


Zuletzt editiert von Jam2 ClanSphere Team am 24.07.2011 um 20:00 Uhr (1x Editiert)
Offline
|
Koffein
Thread-Ersteller


Going for pro




Beiträge: 536
# Antwort: 7 - 24.07.2011 um 20:04 Uhr
Man hab ich gerade lange gebraucht um das mit dem Testlauf zu kapieren xD

Ich muss dich leider enttäuschen, das funktioniert ebenfalls nicht.
Es muss eine 4 sein, dann funktionierts... Wahrscheinlich weil index nicht mit eingerechnet wird...
Danke Jam


Zuletzt editiert von Koffein am 24.07.2011 um 20:09 Uhr (1x Editiert)
Inaktiv
|
Jam2 ClanSphere Team


Highlander





Beiträge: 3291
# Antwort: 8 - 24.07.2011 um 20:33 Uhr
Ach damn^^ War vorhin leicht abgelenkt



------------------
Gruß/ Best regards
Jam2

Nützliche Forumbeiträge/Codepastes: (Useful comments in our board / codepastes)
Template Switch for index.php
Board Navlist last posts

Edi: könnte man denn auch hier eine erweiterung einfügen?
Jam2: das web ist wie toyota.....
Edi: hö ?
Jam2: nichts ist unmöglich!


Offline
|
Koffein
Thread-Ersteller


Going for pro




Beiträge: 536
# Antwort: 9 - 24.07.2011 um 20:36 Uhr
Hauptsache Lösung ist gefunden, dann war mein Ansatz ja nicht ganz verkehrt


Inaktiv
|
Koffein
Thread-Ersteller


Going for pro




Beiträge: 536
# Antwort: 10 - 23.08.2011 um 17:47 Uhr
Ich muss das Thema nochmal wieder aufgreifen, ich würde gerne bei der Erstellung von News und statistischen Seiten auf die index.htm zurückgreifen, damit man es besser sieht wie es später auf der Homepage aussieht, da ich aber die abgetrennte Adminstration nutze um eine admin.htm zu verwenden habe ich bei der Verwirklichung Schwierigkeiten....

Meine index.php sieht wie folgt aus...
 
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
1. / 2. / ... 
<?php
// ClanSphere 2010 - www.clansphere.net
// $Id$
if(!empty($_GET['params'])){
    
$params explode('/'$_GET['params']);
    
$file =  empty($params[1]) ? '' $params[1];
    
$id = empty($params[4]) ? '' $params[4]; 
    
$action = empty($params[2]) ? '' $params[2]; 
}else{
    
$file $_GET['mod'];
    
$id $_GET['id'];
    
$action $_GET['action'];
}
if(
$file == 'board')
    
$htm_file 'board.htm';
    
 elseif(
$file == 'static' AND $id == OR $file == 'static' AND $id == 6)
    
$htm_file 'static.htm';

 elseif(
$file == 'news' AND $action == create)
    
$htm_file 'index.htm';

else 
    
$htm_file 'index.htm';

$cs_main = array('init_sql' => true'init_tpl' => true'tpl_file' => $htm_file);

require_once 
'system/core/functions.php';

cs_init($cs_main);


Hab also jetzt versucht mit folgendem Einrag die index.htm aufzurufen wenn ich eine News erstelle...
 
1.
2.
1. / 2. / ... 
  elseif($file == 'news' AND $action == create)
    
$htm_file 'index.htm';


Das funktioniert leider nicht, kann mir da jemand helfen?


Inaktiv
|
capino


Rock the board




Beiträge: 44
# Antwort: 11 - 20.09.2011 um 15:54 Uhr
Ich hab mal eine Frage, die damit zu tun hat.

Und zwar hab ich 3 verschiedene .htm 's: die board.htm, main.htm und index.htm.

Ich möchte jetzt, dass meine Startseite (domain.de) die index.htm hat, das Forum die board.htm und der Rest die main.htm.

Kann ich hier, wo ......... ist, einen Link zu meiner Startseite einbauen, oder gibt es dafür vielleicht eine schlauere Lösung?

 
1.
2.
3.
4.
5.
6.
7.
8.
1. / 2. / ... 
 if($file == 'board')
    
$htm_file 'board.htm';

 elseif[...........]
    
$htm_file 'index.htm';

else
    
$htm_file 'main.htm';



Danke im Voraus


Inaktiv
|
capino


Rock the board




Beiträge: 44
# Antwort: 12 - 23.09.2011 um 11:58 Uhr
*push*


Inaktiv
|
gamermazzo


Going for pro




Beiträge: 450
# Antwort: 13 - 23.09.2011 um 13:50 Uhr
einfach die index.htm kopieren und in news.htm umbennen

dann einfach

 
1.
2.
1. / 2. / ... 
  if($file == 'news')
    
$htm_file 'news.htm';




------------------
Gruß

Mazzo

Inaktiv
|
TeQu!La ClanSphere Team


Specialist




Herkunft: Grevenbroich
Beiträge: 2142
# Antwort: 14 - 28.05.2013 um 15:28 Uhr
Ich würde das Thema gerne noch einmal aufgreifen weil ich es leider nicht umgesetzt bekomme.
Auf meiner Homepage möchte ich das für die Startseite (eine bestimmte Statische Seite) ein anderes Template genommen wird als für den Rest der Homepage (auch andere Statische Seiten).
Meine index.php sieht wie folgt aus:
 
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
1. / 2. / ... 
<?php
// ClanSphere 2010 - www.clansphere.net
// $Id$
if(!empty($_GET['params'])){
    
$params explode('/'$_GET['params']);
    
$file =  empty($params[1]) ? '' $params[1];
    
$id =  empty($params[4]) ? '' $params[4];
}else{
    
$file $_GET['mod'];
    
$id $_GET['id'];
    
}
if(
$file == 'board')
    
$htm_file 'board.htm';
    
 elseif(
$file == 'static' AND $id == 43)
    
$htm_file 'start.htm';
else 
    
$htm_file 'main.htm';

$cs_main = array('init_sql' => true'init_tpl' => true'tpl_file' => $htm_file);

require_once 
'system/core/functions.php';

cs_init($cs_main);


leider nutzt er auch bei der Startseite (Statische Seite ID=43) das main.htm File

was mache ich falsch und wo liegt der Fehler?


------------------

ClanSphere - professional clan care starts here


Zuletzt editiert von TeQu!La ClanSphere Team am 28.05.2013 um 15:28 Uhr (1x Editiert)
Inaktiv
|
Fr33z3m4n ClanSphere Team


Medal of Honor




Herkunft: Hamm
Beiträge: 11094
# Antwort: 15 - 28.05.2013 um 15:32 Uhr
lass dir doch einfach $file und $id ausgeben, was er zu futtern bekommt.


------------------
mfg
Patrick "Fr33z3m4n" Jaskulski

Antoine de Saint-Exupéry: Wenn Du ein Schiff bauen willst, so trommle nicht Männer zusammen, um Holz zu beschaffen, Aufgaben zu verteilen, sondern lehre die Männer die Sehnsucht nach dem endlosen weiten Meer.

Inaktiv
|
TeQu!La ClanSphere Team


Specialist




Herkunft: Grevenbroich
Beiträge: 2142
# Antwort: 16 - 28.05.2013 um 16:19 Uhr
Lösung:

 
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
1. / 2. / ... 
<?php
// ClanSphere 2010 - www.clansphere.net
// $Id$
if(!empty($_GET['params'])){
    
$params explode('/'$_GET['params']);
    
$file =  empty($params[1]) ? '' $params[1];
    
$id =  empty($params[4]) ? '' $params[4];
}else{
    
$file $_GET['mod'];
    
$id $_GET['id'];
    
}
if(
$file == 'board')
    
$htm_file 'board.htm';
    
 elseif(
$file == 'static' AND $id == 43)
    
$htm_file 'start.htm';
  elseif (empty(
$file) && empty($id))
    
$htm_file 'start.htm';
  else      
$htm_file 'main.htm';

$cs_main = array('init_sql' => true'init_tpl' => true'tpl_file' => $htm_file);

require_once 
'system/core/functions.php';

cs_init($cs_main);


vielen Dank noch einmal an Fr33z3m4n


------------------

ClanSphere - professional clan care starts here


Inaktiv
|
Antworten: 16
Seite [1]


Sie müssen sich registrieren, um zu antworten.