Visualizzazione risultati 1 fino 11 di 11

Discussione: Problema aggiornamento tema topsite

  1. #1
    Guest

    Post Problema aggiornamento tema topsite

    Ciao a tutti, ho fatto l'aggionramento di avakart top site da 5.1.2 a 5.2.0 ed è successa questa cosa:
    http://top100sims.netsons.org
    ma non vi preoccupare se non si vede il css ;) cmq dice alla riga 36:
    Codice PHP:
    <?php
    //===========================================================================\\
    // Aardvark Topsites PHP 5.2 \\
    // Copyright (c) 2000-2007 Jeremy Scheff. All rights reserved. \\
    //---------------------------------------------------------------------------\\
    // http://www.aardvarktopsitesphp.com/ http://www.avatic.com/ \\
    //---------------------------------------------------------------------------\\
    // This program is free software; you can redistribute it and/or modify it \\
    // under the terms of the GNU General Public License as published by the \\
    // Free Software Foundation; either version 2 of the License, or (at your \\
    // option) any later version. \\
    // \\
    // This program is distributed in the hope that it will be useful, but \\
    // WITHOUT ANY WARRANTY; without even the implied warranty of \\
    // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General \\
    // Public License for more details. \\
    //===========================================================================\\

    if (!defined('ATSPHP')) {
    die(
    "This file cannot be accessed directly.");
    }

    class
    skin {
    var
    $filename;

    function
    skin($filename) {
    $this->filename = $filename;
    }

    function
    make() {
    global
    $CONF, $TMPL;

    $file = "{$CONF['skins_path']}/{$TMPL['skin_name']}/{$this->filename}.html";
    $fh_skin = fopen($file, 'r');
    $skin = @fread($fh_skin, filesize($file));
    fclose($fh_skin);

    $parse = 1;

    if (
    $this->filename == 'asd') {
    $powered_by_check = strpos($skin, '{$powered_by}') ? 1 : 0;

    if (
    $powered_by_check) {
    $return = $skin;
    }
    else {
    $return = 'You cannot delete {$powered_by} from wrapper.html.';
    $parse = 0;
    }
    }
    elseif (
    $this->filename == 'admin' || $this->filename == 'ssi_top' || $this->filename == 'ssi_members') {
    $return = $skin;
    }
    else {
    $return = "<!-- Begin {$this->filename}.html -->\n{$skin}<!-- End {$this->filename}.html -->\n\n";
    }

    if (
    $parse) {
    return
    $this->parse($return);
    }
    else {
    return
    $return;
    }
    }

    function
    send_email($email) {
    global
    $CONF, $TMPL;

    $file = "{$CONF['skins_path']}/{$TMPL['skin_name']}/{$this->filename}.html";
    $fh_skin = fopen($file, "r");
    $skin = @fread($fh_skin, filesize($file));
    fclose($fh_skin);

    $skin_array = explode("\n", $skin);

    $subject = array_shift($skin_array);
    $subject = str_replace('Subject: ', '', $subject);
    $body = implode("\n", $skin_array);

    $subject = $this->parse($subject);
    $body = $this->parse($body);

    mail($email, $subject, $body, "From: {$CONF['your_email']}\r\n");
    }

    function
    parse($skin) {
    global
    $LNG, $TMPL, $n, $parse_time;

    $skin = preg_replace_callback('/{\$lng->(.+?)}/i', create_function('$matches', 'global $LNG; return $LNG[$matches[1]];'), $skin);
    $skin = preg_replace_callback('/{\$(.+?)}/i', create_function('$matches', 'global $TMPL; return $TMPL[$matches[1]];'), $skin);
    $skin = preg_replace_callback('/{include \"(.+?)\"}/i', create_function('$matches', 'return file_get_contents($matches[1]);'), $skin);

    return
    $skin;
    }

    function
    callback($matches) {
    return
    $matches[1];
    }
    }

    class
    main_skin extends skin {
    function
    main_skin($filename) {
    global
    $CONF, $DB, $FORM, $LNG, $TIMER, $TMPL;

    $this->filename = $filename;

    // Number of members
    list($TMPL['num_members']) = $DB->fetch("SELECT COUNT(*) FROM {$CONF['sql_prefix']}_sites WHERE active = 1", __FILE__, __LINE__);

    // Build the multiple pages menu
    if ($TMPL['num_members'] > $CONF['num_list']) {
    $num = $TMPL['num_members'];
    $done = 0;
    $TMPL['multiple_pages_menu'] = "<select name=\"start\">\n";
    while (
    $num > 0) {
    $start = $done * $CONF['num_list'] + 1;
    $end = ($done + 1) * $CONF['num_list'];
    if (
    $end >= $TMPL['num_members']) { $end = $TMPL['num_members']; }
    $FORM['start'] = isset($FORM['start']) ? $FORM['start'] : 1;

    if (
    $FORM['start'] == $start) {
    $TMPL['multiple_pages_menu'] .= "<option value=\"{$start}\" selected=\"selected\">{$start} - {$end}</option>\n";
    }
    else {
    $TMPL['multiple_pages_menu'] .= "<option value=\"{$start}\">{$start} - {$end}</option>\n";
    }

    $num = $num - $CONF['num_list'];
    $done++;
    }
    $TMPL['multiple_pages_menu'] .= '</select>';
    }
    else {
    $TMPL['multiple_pages_menu'] = ''; }

    // Build the ranking method menu
    $ranking_method = isset($FORM['method']) ? $FORM['method'] : $CONF['ranking_method'];
    $TMPL['ranking_methods_menu'] = '<select name="method">'."\n";
    if (
    $ranking_method == 'pv') { $TMPL['ranking_methods_menu'] .= "<option value=\"pv\" selected=\"selected\">{$LNG['g_pv']}</option>\n"; }
    else {
    $TMPL['ranking_methods_menu'] .= "<option value=\"pv\">{$LNG['g_pv']}</option>\n"; }
    if (
    $ranking_method == 'in') { $TMPL['ranking_methods_menu'] .= "<option value=\"in\" selected=\"selected\">{$LNG['g_in']}</option>\n"; }
    else {
    $TMPL['ranking_methods_menu'] .= "<option value=\"in\">{$LNG['g_in']}</option>\n"; }
    if (
    $ranking_method == 'out') { $TMPL['ranking_methods_menu'] .= "<option value=\"out\" selected=\"selected\">{$LNG['g_out']}</option>\n"; }
    else {
    $TMPL['ranking_methods_menu'] .= "<option value=\"out\">{$LNG['g_out']}</option>\n"; }
    $TMPL['ranking_methods_menu'] .= '</select>';

    // Build the categories menu and feed.php link
    $TMPL['feed'] = 'feed.php';
    $current_cat = isset($FORM['cat']) ? $FORM['cat'] : $LNG['main_all'];
    $TMPL['categories_menu'] = "<select name=\"cat\">\n";
    if (
    $current_cat == $LNG['main_all']) {
    $TMPL['categories_menu'] .= "<option value=\"\" selected=\"selected\">{$LNG['main_all']}</option>\n";
    }
    else {
    $TMPL['categories_menu'] .= "<option value=\"\">{$LNG['main_all']}</option>\n";
    }
    foreach (
    $CONF['categories'] as $cat => $skin) {
    if (
    $current_cat == $cat) {
    $TMPL['categories_menu'] .= "<option value=\"{$cat}\" selected=\"selected\">{$cat}</option>\n";
    $TMPL['feed'] .= "?cat={$cat}";
    }
    else {
    $TMPL['categories_menu'] .= "<option value=\"{$cat}\">{$cat}</option>\n";
    }
    }
    $TMPL['categories_menu'] .= '</select>';

    // Featured member
    if ($CONF['featured_member'] && $TMPL['num_members']) {
    $result = $DB->select_limit("SELECT username, url, title, description, banner_url FROM {$CONF['sql_prefix']}_sites WHERE active = 1 ORDER BY RAND()", 1, 0, __FILE__, __LINE__);
    $row = $DB->fetch_array($result);
    $TMPL = array_merge($TMPL, $row);

    $TMPL['featured_member'] = base::do_skin('featured_member');
    }

    $TMPL['query'] = isset($TMPL['query']) ? $TMPL['query'] : '';

    // Please do not remove the link to http://www.aardvarktopsitesphp.com/.
    // This is a free script, all I ask for is a link back.
    $TMPL['asd'] = $LNG['main_powered'].' <a href="http://www.aardvarktopsitesphp.com/"><b>Aardvark Topsites PHP</b></a> '.$TMPL['version'];

    // If you want to remove these links, you can; however, I would appreciate
    // it if you left them there.
    $TMPL['asd'] .= '<br /><a href="http://www.unitedmortgagerates.com/">Mortgage Rates</a> | <a href="http://www.mydebtconsolidationadvice.com/">Debt Consolidation</a> | <a href="http://www.casinowatchdogs.com/">Online Casino</a>';

    if (!isset(
    $TMPL['content'])) { $TMPL['content'] = ''; }

    $TMPL['num_queries'] = $DB->num_queries;
    $TMPL['execution_time'] = $TIMER->get_time();
    }
    }
    ?>
    ma perchè? o.o...grazie..ciao Davide..
    ps..sto cercando di adattare il tema della 5.1.2 alla 5.2.0 ^^..ciao Davide.
    Ultima modifica di sIM : 31-07-2007 alle ore 11.45.14

  2. #2
    Ospite Guest

    Predefinito

    Non ho capito cosa chiedi, potresti spiegarti meglio per favore? :)

  3. #3
    Guest

    Post

    Credo che il problema sia risolto ^_^..ma per sicurezza non chiedere la discussione ;) ..ma ora ho questo problema (sempre di php+img) non mi si vede l'img per votare:
    http://top100sims.netsons.org/button.php?u=simdavide
    da errore...perchè?
    Codice PHP:
    <?php
    if (!defined('ATSPHP')) {
    die(
    "This file cannot be accessed directly.");
    }

    $TMPL = $DB->fetch("SELECT *
    FROM
    {$CONF['sql_prefix']}_sites sites, {$CONF['sql_prefix']}_stats stats
    WHERE sites.username = stats.username AND sites.username = '
    {$username}'", __FILE__, __LINE__);
    if (
    $rank) {
    $TMPL['rank'] = $rank;
    }
    else {
    $TMPL['rank'] = $TMPL['old_rank'];
    }

    $TMPL['average_rating'] = $TMPL['num_ratings'] > 0 ? round($TMPL['total_rating'] / $TMPL['num_ratings'], 0) : 0;

    $ranking_periods = array('daily', 'weekly', 'monthly');
    $ranking_methods = array('unq_pv', 'tot_pv', 'unq_in', 'tot_in', 'unq_out', 'tot_out');
    foreach (
    $ranking_periods as $ranking_period) {
    foreach (
    $ranking_methods as $ranking_method) {
    $TMPL["{$ranking_method}_avg_{$ranking_period}"] = 0;
    for (
    $i = 0; $i < 10; $i++) {
    $TMPL["{$ranking_method}_avg_{$ranking_period}"] = $TMPL["{$ranking_method}_avg_{$ranking_period}"] + $TMPL["{$ranking_method}_{$i}_{$ranking_period}"];
    }
    $TMPL["{$ranking_method}_avg_{$ranking_period}"] = $TMPL["{$ranking_method}_avg_{$ranking_period}"] / 10;
    }
    }

    $TMPL['average_rating'] = $TMPL['num_ratings'] > 0 ? round($TMPL['total_rating'] / $TMPL['num_ratings'], 0) : 0;

    $img = imagecreatefrompng("{$CONF['path']}/images/ranking.gif");
    $color1 = imagecolorallocate($img, 0, 0, 255);
    $color2 = imagecolorallocate($img, 255, 255, 255);
    header ("Content-type: image/png");
    imagestring($img, 2, 52, 0, $TMPL['unq_pv_0_daily'], $color1);
    imagestring($img, 2, 60, 11, $TMPL['unq_pv_avg_daily'], $color1);
    imagestring($img, 2, 33, 24, "{$TMPL['average_rating']}/5", $color1);
    imagestring($img, 5, 126 - ((strlen($TMPL['rank']) - 1) * 4), 20, $TMPL['rank'], $color2);
    imagepng($img);
    ?>
    l'img è questa: http://top100sims.netsons.org/images/raking.png
    http://top100sims.netsons.org/images/raking.gif
    http://top100sims.netsons.org/images/ranking.png
    http://top100sims.netsons.org/images/ranking.gif
    Grazie..ciao Davide ^^
    Ultima modifica di sIM : 30-07-2007 alle ore 21.01.22

  4. #4
    Ospite Guest

    Predefinito

    Al posto di:
    Codice PHP:
    $img = imagecreatefrompng("{$CONF['path']}/images/ranking.gif");
    metti:
    Codice PHP:
    $img = imagecreatefrompng("{$CONF['path']}/images/raking.png");

  5. #5
    Guest

    Predefinito

    uff...ho fatto come hai detto ma niente :( allora visto ho provato a "strumentiare" ed è uscito fuori..ma ci sono dei numeri ed è fermo!! http://top100sims.netsons.org/button.php?u=simdavide
    Codice PHP:
    <?php
    if (!defined('ATSPHP')) {
    die(
    "This file cannot be accessed directly.");
    }

    $TMPL = $DB->fetch("SELECT *
    FROM
    {$CONF['sql_prefix']}_sites sites, {$CONF['sql_prefix']}_stats stats
    WHERE sites.username = stats.username AND sites.username = '
    {$username}'", __FILE__, __LINE__);
    if (
    $rank) {
    $TMPL['rank'] = $rank;
    }
    else {
    $TMPL['rank'] = $TMPL['old_rank'];
    }

    $TMPL['average_rating'] = $TMPL['num_ratings'] > 0 ? round($TMPL['total_rating'] / $TMPL['num_ratings'], 0) : 0;

    $ranking_periods = array('daily', 'weekly', 'monthly');
    $ranking_methods = array('unq_pv', 'tot_pv', 'unq_in', 'tot_in', 'unq_out', 'tot_out');
    foreach (
    $ranking_periods as $ranking_period) {
    foreach (
    $ranking_methods as $ranking_method) {
    $TMPL["{$ranking_method}_avg_{$ranking_period}"] = 0;
    for (
    $i = 0; $i < 10; $i++) {
    $TMPL["{$ranking_method}_avg_{$ranking_period}"] = $TMPL["{$ranking_method}_avg_{$ranking_period}"] + $TMPL["{$ranking_method}_{$i}_{$ranking_period}"];
    }
    $TMPL["{$ranking_method}_avg_{$ranking_period}"] = $TMPL["{$ranking_method}_avg_{$ranking_period}"] / 10;
    }
    }

    $TMPL['average_rating'] = $TMPL['num_ratings'] > 0 ? round($TMPL['total_rating'] / $TMPL['num_ratings'], 0) : 0;

    $img = imagecreatefromgif("{$CONF['path']}/images/raking.gif");
    $color1 = imagecolorallocate($img, 0, 0, 255);
    $color2 = imagecolorallocate($img, 255, 255, 255);
    header ("Content-type: image/gif");
    imagestring($img, 2, 52, 0, $TMPL['unq_pv_0_daily'], $color1);
    imagestring($img, 2, 60, 11, $TMPL['unq_pv_avg_daily'], $color1);
    imagestring($img, 2, 33, 24, "{$TMPL['average_rating']}/5", $color1);
    imagestring($img, 5, 126 - ((strlen($TMPL['rank']) - 1) * 4), 20, $TMPL['rank'], $color2);
    imagegif($img);
    ?>
    Grazie.Ciao Davide ^^

  6. #6
    Ospite Guest

    Predefinito

    Ma cosa dovrebbe succedere se si clicca su quel bottone?
    Io ti ho solo aggiustato il percorso dell'immagine che non si vedeva, come da tua unica richiesta.

  7. #7
    Guest

    Predefinito

    allora problema risolto ^^
    ora ne ho un'altro :P..
    volevo sapere perchè si vede male la tabbella dei siti in home..posto il codice del template..il file si chiama:table_top_row.html
    se andate in home page...manka 1 pezzo verso destra..http://top100sims.netsons.org...xkè?^^..vi posto il codice:
    Codice:
    <html>
    
    
    <table width="100%" cellpadding=0 cellspacing=1 border=1 bordercolor="#A5B8C9" style="border-collapse: collapse">
    
    <td>
    
    <table width="100%" cellpadding=2 cellspacing=1>
    
    <tr>
    <td class="mediumbg" colspan="4" align="left">
    <h3>{$rank} <img src="{$skins_url}/{$skin_name}/{$up_down}.gif" alt="{$lng->up_down}" />
    <a href="{$url}" target="_blank" onclick="out('{$username}');" class="table_top">{$title}</a> - 
    <a href="{$list_url}/index.php?a=stats&amp;u={$username}" class="table_top">{$lng->table_stats}</a></h3>
    </td></tr><tr class="lightbg"><td rowspan="4" valign="top" align="left">
    <img src="{$banner_url}" alt="{$title}" style="width:88px;height:31px;float:left">{$description}<br />
    <em>{$lng->g_category}: <a href="{$list_url}/index.php?cat={$category}">{$category}</a></em>
    </td>
    
    <td width="55"> </td>
    <td width="55"><b>{$lng->g_this_period}</b></td>
    
    <td width="55"><b>{$lng->g_average}</b></td>
    </tr><tr class="lightbg">
    <td width="55"><b>Unique</b></td>
    <td width="55">{$this_period}</td>
    <td width="55">{$average}</td>
    </tr><tr class="lightbg">
    <td width="55"><b>Total</b></td>
    <td width="55">{$tot_pv_0_daily}</td>
    <td width="55">{$tot_pv_avg_daily}</td>
    </tr>
    
    <tr class="lightbg">
    
    <td width="55" align="center"><a href="{$list_url}/index.php?a=stats&amp;u={$username}"><img src="{$skins_url}/{$skin_name}/stats.gif" width="19" height="16" border="0" alt="<#lng{'table_stats'}>"></a></td>
    <td colspan="2" align="center"><img src="{$skins_url}/{$skin_name}/rate{$average_rating}.gif" width="88" height="16" alt="{$average_rating}/5"></td>
    </tr></table>
    
    </td></table>
    
    <br />
    Grazoe.Ciao Davide ^^

  8. #8
    Ospite Guest

    Predefinito

    Ma ti vuoi decidi a spiegare meglio i tuoi problemi o dobbiamo farti duemila domande per capire cosa cerchi e poi rifiuti di rispondere?
    Ti è già stato detto in quasi tutti i topics che hai aperto di essere più specifico nelle tue domande e di scrivere in italiano.
    Che significa "manka 1 pezzo verso destra"?
    Se ci chiedi di offrirti supporto lo facciamo volontariamente e nessuno ci paga per aiutarti, ma almeno non complicarci la vita.

  9. #9
    Guest

    Predefinito

    allora il problema e che non sapevo come spiegarlo O.o come vedete la tabbella di destra continua..ma non si vede...
    http://img443.imageshack.us/img443/9411/asdasdzl3.jpg
    perchè? ^^..grazie..ciao Davide :D

  10. #10
    Ospite Guest

    Predefinito

    Probabilmente il css del portale non è adatto alla risoluzione che hai in uso tu.
    Io infatti con risoluzione 1024 * 768 visualizzo in modo corretto la pagina.
    Ciao!

  11. #11
    Guest

    Predefinito

    ah ok^^..grazie probid ^^...ora kredo ke non ci sia più niente :D

Regole di scrittura

  • Non puoi creare nuove discussioni
  • Non puoi rispondere ai messaggi
  • Non puoi inserire allegati.
  • Non puoi modificare i tuoi messaggi
  •