• User Attivo

    directory con titoli pagine diversi...

    Ciao a tutti, premetto che sono una schiappa con il php...per questo chiedo aiuto

    in pratica ho uno script per creare una directory...dovrei semplicemente far cambiare titolo (tag title) alle pagine a seconda della categoria in cui ci troviamo...quindi title=categoria.

    Dovrebbe esser semplice...però ho dei problemi. Lo script, gia fatto, invece della categoria come title mi riporta il titolo del sito, sempre uguale in ogni pagina.

    nel file config.php c'è appunto la variabile $namesite

    nel file listing.php (quello della categoria) infatti riporta questo codice:

    code:<?
    include ("./dirinc/config.inc.php");
    include ($header);
    include ("./dirinc/general.class.php");
    ?>

    header.php ha questo codice:

    <html>
    <head>
    <title>
    <? echo $sitename ?>
    </title>
    </head>

    quindi cambiando $sitename con la variabile della categoria dovrebbe funzionare?...ma che...

    dove sbaglio?

    aiuto please...


  • User Attivo

    credo sia lo steso script che ha usato giorgio per la directory http://www.giorgiotave.it/directory/

    infatti per lui compare il title della categoria...giorgio come si fa?

    😉


  • User

    La variabile come e dove la prendi?
    Ti dà qualche errore o nn ti scrive nulla e lo script è tranquillo e viene letto?


  • User Attivo

    eheh...vado molto a intuito 🙂

    cmq essendoci il file listing.php (nel file config.php non riesco a capire quale sia) che elenca i siti delle categorie e riporta la barra di navigazione con appunto la voce della categoria...ho preso la variabile di quest'ultima voce... 😢 ma non funge...non mi da niente nel title e lo script funziona perfettamente...

    ecco il file config.php dove ho inserito il nome del sito, ma non vedo quella delle categorie

    <?
    // leave this setting, used to ignore config file for click through script
    if &#40;$click != "yes"&#41; &#123;
    
    // admin password and username
    $username = "andrea";
    $password = "catarsi";
    
    // configuration setup
    $authreq = 0;  // are entires automatically added or require authorisation - 1 yes, 0 no &#40;requires auth by admin&#41;
    $automail = 1; // e-mails auto sent to submitter and web admin - 1 yes, 0 no
    
    $subshow = 3; // no. of sub-categories shown on main page below main category default 2
    $searchresults = 10; //  search results returned
    $catlinkreq = 1; // allow links to be added without category set - 1  yes , 0 no
    $mod = 1; // allow mods on index page- 1 = yes / 0 =no
    $mod_sub =0; // allow mods on sub pages - 1 = yes / 0 = no
    $s_catlink = 1; // allow category linkdetails on search page - 1 yes , 0 no &#40;not sure of db effects requires benchmarking&#41;
    
    $cols = "2";  // number of table colums on home page
    $sublinks = "3"; // number of sub links to show on home page
    $catcols = "3"; // number of colums on listings page for subcatergories
    $colper = 100/$cols; // calculation required please leave as is
    $catcolper = 100/$catcols; // calculation required please leave as is
    $border = "0"; 
    $style = "";
    $titlebg = "";
    $foldergif = "folder1.gif"; // category folder image, put in images directory
    $eff = ", "; // if comma leave 1 space, if 
     or 
    
    tag leave 2 spaces at end
    $hrcolor = " color=\"#C0C0FF\""; // color of HR line
    $topstyle = "cellpadding=\"0\" cellspacing=\"0\""; //style for main table
    $menuheader = "";
    
    $sitename = "Volivacanza"; //  enter your site name here
    $bgcolor = "#808080"; //  header and footer background table color
    
    $version = "3.0.0"; // leave this setting ALP-site directory version number
    $weburl = "http://www.phpeachee.com"; // leave this setting, host site
    
    $headeri = "./templates/headeri1.inc.php"; // header for index - overwrtitten if template used
    $footeri = "./templates/footeri1.inc.php"; // footer for index - overwrtitten if template used
    $header = "./templates/header1.inc.php"; // header for rest - overwrtitten if template used
    $footer = "./templates/footer1.inc.php"; // footer for rest - overwrtitten if template used
    
    // langauge pack 
    $lang = "lan.en.php"; // default english
    
    // style settings
    if &#40;stristr&#40;$PHP_SELF, diradmin&#41; == TRUE&#41; &#123;
    $css = "../dirinc/dir.css"; // will be over written if template used
    &#125;
    else &#123;
    $css = "./dirinc/dir.css"; // will be over written if template used
    &#125;
    
    // template settings
    if &#40;stristr&#40;$PHP_SELF, diradmin&#41; == TRUE&#41; &#123;
    $templatedir = "../templates/";
    &#125;
    else &#123;
    $templatedir = "./templates/";
    &#125;
    
    $templatefile = "template1.inc.php"; // which template to use
    
    // 1 = default - 'template1.inc.php'
    // 2 = slick style - 'template2.inc.php'
    // 3 = phpeachee style - 'template3.inc.php'
    
    $template = $templatedir . $templatefile; 
    
    
    // mail settings text
    $mymail = ""; // your admin e-mail for notification
    $from = "site admin";
    $subject = "Website entry for Site Directory";
    $newsite = "Thank you for completing the on-line form to add your site to the site directory.\n";
    $newsite .="Once we have checked over the site to ensure it is a valid site will we then notify you via e-mail of approval.\n";
    $newsite .="";
    $approvesubject = "Website entry for Site Directory"; // subject of e-mail once approval e-mail sent
    $approved ="Your site has been approved for the site directory.  Your details will be live under your choosen category."; // message body of e-mail once approval e-mail sent
    
    // site submit text
    $emailsent ="Your details have been e-mailed to our administration team, you will also receive details of your submission.";
    $approval ="Once your site as been approved we will notify you via e-mail and your site will then be live.
    
    ";
    $approval .="We aim to approve all sites within 48hrs.";
    $thankyou ="Thank you for taking the time to submit your site.";
    
    // loading langauge pack
    if &#40;stristr&#40;$PHP_SELF, diradmin&#41; == TRUE&#41; &#123;
    include &#40;"../dirinc/$lang"&#41;;
    &#125;
    else &#123;
    include &#40;"./dirinc/$lang"&#41;;
    &#125;
    
    &#125;
    // database settings
    $host = "localhost"; // host name of web site ie www.phpeachee.com
    $user = ""; // username for database
    $pwd = ""; // password for database
    $dbname = ""; // database name to connect to
    
    // connect to database - leave the following settings
    @mysql_connect&#40;$host, $user, $pwd&#41; or DIE&#40;"Temporary Server Problems Please Try Again"&#41;;
    mysql_select_db&#40;$dbname&#41;;
    
    // loading template options if required
    if &#40;$templatefile != ''&#41; &#123;
    include &#40;"$template"&#41;;
    &#125;
    ?>