php script do html (freeglobes)

Programovacie jazyky, rady, poradňa...
lucas03
Darca
Darca
Používateľov profilový obrázok
Príspevky: 717
Registrovaný: 19 nov 2005, 14:43
Bydlisko: Brno

php script do html (freeglobes)

Príspevok od používateľa lucas03 »

Ahoj,
spravil som si script, aby som mal na kazdu kategoriu vo freeglobes iny odkaz. Je to taketo nieco.

Kód: Vybrať všetko

<?php

$category1='<a href="http://ludske-charaktery.ym.sk/">Ľudské charaktery</a>';

$category2='';

$category3='';

$category4='';

$category5='';

$category6='';

$category7='';

$category8='';

$category9='';

$category10='';

$category11='';

$category12='';

$category13='';

$category14='';

$category15='';

$category16='';

$category17='';

$category18='';

$category19='';

$category20='';

$category21='';

$category22='';

$category23='';

$category24='';



$theurl = $_SERVER['REQUEST_URI'];

        if (strpos($theurl, "auto-moto-c-12")) echo $category1;

        if (strpos($theurl, "cestovn-c-14")) echo $category2;

        if (strpos($theurl, "elektro-c-17")) echo $category3;

        if (strpos($theurl, "finance-c-20")) echo $category4;

        if (strpos($theurl, "po-tae-internet-c-1")) echo $category5;

        if (strpos($theurl, "reality-c-28")) echo $category6;

        if (strpos($theurl, "sport-c-22")) echo $category7;

        if (strpos($theurl, "zbava-c-32")) echo $category8;

        if (strpos($theurl, "bazary-c-124")) echo $category9;

        if (strpos($theurl, "dm-zahrada-c-16")) echo $category10;

        if (strpos($theurl, "erotika-c-18")) echo $category11;

        if (strpos($theurl, "fitness-c-21")) echo $category12;

        if (strpos($theurl, "prce-c-26")) echo $category13;

        if (strpos($theurl, "koly-c-30")) echo $category14;

        if (strpos($theurl, "stavebnictv-c-29")) echo $category15;

        if (strpos($theurl, "zdrav-c-33")) echo $category16;

        if (strpos($theurl, "bl-zbo--c-13")) echo $category17;

        if (strpos($theurl, "e-shopy-c-9")) echo $category18;

        if (strpos($theurl, "film-c-19")) echo $category19;

        if (strpos($theurl, "kultura-c-23")) echo $category20;

        if (strpos($theurl, "pjovny-c-27")) echo $category21;

        if (strpos($theurl, "sluby-c-15")) echo $category22;

        if (strpos($theurl, "ubytovn-c-31")) echo $category23;

        if (strpos($theurl, "zpravodajstv-c-34")) echo $category24;
?>
Takze by mi malo echovat inu premennu podla kategorie. Avsak vo freeglobes su templaty len html. Takze to neincludnem cez php script. Tak som potom pozrel ako to robia, maju to sparovane cez index.php. kde to paruju nejako takto:

Kód: Vybrať všetko

case 'links':
    $template = 'links.html';
    $include = 'links.php';
    break;
Lenze tam zase len nacita premenne a vypise ich podla links.html. Ako to spojazdnit, mate niekto katalog pripadne riesenie?
audiotrack
VIP
VIP
Používateľov profilový obrázok
Príspevky: 25958
Registrovaný: 09 sep 2005, 18:39
Kontaktovať používateľa:

Re: php script do html (freeglobes)

Príspevok od používateľa audiotrack »

podľa webu freeglobes používa smarty, takže by tam malo isť použiť php v template. Len ho zapíš medzi {php} a {/php}

a inak, ku freeglobes boli jeho negatíva pekne spísané tu: http://www.osobak.cz/2010/01/freeglobes ... ry-system/ Možno by si si to mal prečítať
lucas03
Darca
Darca
Používateľov profilový obrázok
Príspevky: 717
Registrovaný: 19 nov 2005, 14:43
Bydlisko: Brno

Re: php script do html (freeglobes)

Príspevok od používateľa lucas03 »

Viem ze je to zly system, preto som s tym ani nerobil, robili to pre mna ludia, ale teraz nemal cas a musim si to sam spravit, a bohuzial to musel byt freeglobes kvoli napajaniu na bleskovaregistrace.
// kazdopadne zas raz dik, skusim to.
//<{php}> a <{/php}> funguje.
Napísať odpoveď