Problem with 5.2.0.

Can't get it installed? Not sure how a feature works? Then post here.

Problem with 5.2.0.

Postby alexander7070 » 2008-01-08 07:55 am

Hi! Now I have made upgrade my top rating from version 5.0.2. to 5.2.0. Version very good, thanks!. But there is a bug. When I Approve site "Approve" button, all it is OK, in the rating site, to the user sends e-mail with htnl code of the counter. But if I approve site by clicking on the "Edit Member", and then to the "Active (Listed)", the site also is included in the ranking, but e-mail with html code of button will not send to the user! It possible to solve the problem?

Sincerely, Alexander
alexander7070
Advanced Member
 
Posts: 51
Joined: 2007-02-28 02:37 pm

Re: Problem with 5.2.0.

Postby alexander7070 » 2008-01-09 12:42 pm

Actually, not scared, I authorize sites by click "Approve". Overall, a very good sript, spam protection impenetrable. With version 5.0.2 had problems because of spam, the Turkish spammers almost spoil server that works my site. Thank you very much for the script!

Sincerely, Alexander
alexander7070
Advanced Member
 
Posts: 51
Joined: 2007-02-28 02:37 pm

Re: Problem with 5.2.0.

Postby Jeremy » 2008-01-09 07:56 pm

i haven't tested this code, so it may or may not work correctly. if it doesn't, let me know what the error is, or maybe you can fix it.

find this in sources/admin/edit.php:
Code: Select all
      $short_url = in::short_url($TMPL['url']);

after it, put this:
Code: Select all
    list($TMPL['username'], $TMPL['email'], $active_old) = $DB->fetch("SELECT username, email, active FROM {$CONF['sql_prefix']}_sites WHERE username = '{$username}'", __FILE__, __LINE__);
      if ($active_old == 0 && $TMPL['active'] == 1) {
      if ($CONF['google_friendly_links']) {
        $TMPL['verbose_link'] = "";
      }
      else {
        $TMPL['verbose_link'] = "index.php?a=in&u={$TMPL['username']}";
      }
      $TMPL['link_code'] = $this->do_skin('link_code');

      $LNG['join_welcome'] = sprintf($LNG['join_welcome'], $TMPL['list_name']);

      $join_email = new skin('join_email');
      $join_email->send_email($TMPL['email']);
    }
Jeremy
Supreme Diety
 
Posts: 8922
Joined: 2003-05-05 04:41 pm
Location: NJ, USA

Re: Problem with 5.2.0.

Postby alexander7070 » 2008-01-10 11:48 am

No, unfortunately not working, letters are not sent. Here is the full text file:


<?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 edit extends join_edit {
function edit() {
global $CONF, $DB, $FORM, $LNG, $TMPL;

$TMPL['header'] = $LNG['a_edit_header'];

$TMPL['error_username'] = '';
$TMPL['error_style_username'] = '';
$TMPL['error_password'] = '';
$TMPL['error_style_password'] = '';
$TMPL['error_url'] = '';
$TMPL['error_style_url'] = '';
$TMPL['error_email'] = '';
$TMPL['error_style_email'] = '';
$TMPL['error_title'] = '';
$TMPL['error_style_title'] = '';
$TMPL['error_banner_url'] = '';
$TMPL['error_style_banner_url'] = '';
$TMPL['error_captcha'] = '';
$TMPL['error_style_captcha'] = '';

$TMPL['username'] = $DB->escape($FORM['u']);
list($check) = $DB->fetch("SELECT 1 FROM {$CONF['sql_prefix']}_sites WHERE username = '{$TMPL['username']}'", __FILE__, __LINE__);
if ($check) {
if (!isset($FORM['submit'])) {
$this->form();
}
else {
$this->process();
}
}
else {
$this->error($LNG['g_invalid_u'], 'admin');
}
}

function form() {
global $CONF, $DB, $LNG, $TMPL;

if (!isset($TMPL['url'])) {
$row = $DB->fetch("SELECT * FROM {$CONF['sql_prefix']}_sites WHERE username = '{$TMPL['username']}'", __FILE__, __LINE__);
$TMPL = array_merge($TMPL, $row);
}
else {
if (isset($TMPL['url'])) { $TMPL['url'] = stripslashes($TMPL['url']); }
if (isset($TMPL['title'])) { $TMPL['title'] = stripslashes($TMPL['title']); }
if (isset($TMPL['description'])) { $TMPL['description'] = stripslashes($TMPL['description']); }
if (isset($TMPL['category'])) { $TMPL['category'] = stripslashes($TMPL['category']); }
if (isset($TMPL['banner_url'])) { $TMPL['banner_url'] = stripslashes($TMPL['banner_url']); }
if (isset($TMPL['email'])) { $TMPL['email'] = stripslashes($TMPL['email']); }
}

$TMPL['categories_menu'] = "<select name=\"category\">\n";
foreach ($CONF['categories'] as $cat => $skin) {
if ($TMPL['category'] == $cat) {
$TMPL['categories_menu'] .= "<option value=\"{$cat}\" selected=\"selected\">{$cat}</option>\n";
}
else {
$TMPL['categories_menu'] .= "<option value=\"{$cat}\">{$cat}</option>\n";
}
}
$TMPL['categories_menu'] .= '</select>';

$TMPL['active_menu'] = "<select name=\"active\">\n";
if ($TMPL['active'] == 1) {
$TMPL['active_menu'] .= "<option value=\"1\" selected=\"selected\">{$LNG['a_edit_active']}</option>\n<option value=\"0\">{$LNG['a_edit_inactive']}</option>\n";
}
else {
$TMPL['active_menu'] .= "<option value=\"1\">{$LNG['a_edit_active']}</option>\n<option value=\"0\" selected=\"selected\">{$LNG['a_edit_inactive']}</option>\n";
}
$TMPL['active_menu'] .= '</select>';

if ($CONF['max_banner_width'] && $CONF['max_banner_height']) {
$TMPL['join_banner_size'] = sprintf($LNG['join_banner_size'], $CONF['max_banner_width'], $CONF['max_banner_height']);
}
else {
$TMPL['join_banner_size'] = '';
}

$TMPL['url'] = htmlspecialchars($TMPL['url']);
$TMPL['title'] = htmlspecialchars($TMPL['title']);
$TMPL['description'] = htmlspecialchars($TMPL['description']);
$TMPL['banner_url'] = htmlspecialchars($TMPL['banner_url']);
$TMPL['email'] = htmlspecialchars($TMPL['email']);

$TMPL['admin_content'] = <<<EndHTML
<form action="{$TMPL['list_url']}/index.php?a=admin&amp;b=edit&amp;u={$TMPL['username']}" method="post">
<fieldset>
<legend>{$LNG['join_website']}</legend>
<div class="{$TMPL['error_style_url']}"><label>{$LNG['g_url']}<br />
<input type="text" name="url" size="50" value="{$TMPL['url']}" />
{$TMPL['error_url']}
</label></div><br />
<div class="{$TMPL['error_style_title']}"><label>{$LNG['g_title']}<br />
<input type="text" name="title" size="50" value="{$TMPL['title']}" />
{$TMPL['error_title']}
</label></div><br />
<label>{$LNG['g_description']}<br />
<textarea cols="40" rows="5" name="description">{$TMPL['description']}</textarea><br /><br />
</label>
<label>{$LNG['g_category']}<br />
{$TMPL['categories_menu']}<br /><br />
</label>
<div class="{$TMPL['error_style_banner_url']}"><label>{$LNG['g_banner_url']} {$TMPL['join_banner_size']}<br />
<input type="text" name="banner_url" size="50" value="{$TMPL['banner_url']}" />
{$TMPL['error_banner_url']}
</label></div><br />
<div class="{$TMPL['error_style_email']}"><label>{$LNG['g_email']}<br />
<input type="text" name="email" size="50" value="{$TMPL['email']}" />
{$TMPL['error_email']}
</label></div>
</fieldset>

<fieldset>
<legend>{$LNG['join_user']}</legend>
<label>{$LNG['g_password']} - {$LNG['edit_password_blank']}<br />
<input type="password" name="password" size="20" /><br /><br />
</label>
<label>{$LNG['a_edit_site_is']}<br />
{$TMPL['active_menu']}<br /><br />
</label>
<input name="submit" type="submit" value="{$LNG['a_edit_header']}" />
</fieldset>
</form>
EndHTML;
}

function process() {
global $CONF, $DB, $FORM, $LNG, $TMPL;

$TMPL['url'] = $DB->escape($FORM['url']);
$TMPL['title'] = $DB->escape($FORM['title']);
$TMPL['description'] = $DB->escape($FORM['description']);
$TMPL['category'] = $DB->escape($FORM['category']);
$TMPL['banner_url'] = $DB->escape($FORM['banner_url']);
$TMPL['email'] = $DB->escape($FORM['email']);
$TMPL['active'] = intval($FORM['active']);

if ($this->check_input('edit')) {
if ($FORM['password']) {
$password = md5($FORM['password']);
$password_sql = ", password = '{$password}'";
}
else {
$password_sql = '';
}

require_once("{$CONF['path']}/sources/in.php");
$short_url = in::short_url($TMPL['url']);
list($TMPL['username'], $TMPL['email'], $active_old) = $DB->fetch("SELECT username, email, active FROM {$CONF['sql_prefix']}_sites WHERE username = '{$username}'", __FILE__, __LINE__);
if ($active_old == 0 && $TMPL['active'] == 1) {
if ($CONF['google_friendly_links']) {
$TMPL['verbose_link'] = "";
}
else {
$TMPL['verbose_link'] = "index.php?a=in&u={$TMPL['username']}";
}
$TMPL['link_code'] = $this->do_skin('link_code');

$LNG['join_welcome'] = sprintf($LNG['join_welcome'], $TMPL['list_name']);

$join_email = new skin('join_email');
$join_email->send_email($TMPL['email']);
}

$DB->query("UPDATE {$CONF['sql_prefix']}_sites SET url = '{$TMPL['url']}', short_url = '{$short_url}', title = '{$TMPL['title']}', description = '{$TMPL['description']}', category = '{$TMPL['category']}', banner_url = '{$TMPL['banner_url']}', email = '{$TMPL['email']}', active = {$TMPL['active']}{$password_sql} WHERE username = '{$TMPL['username']}'", __FILE__, __LINE__);

$TMPL['admin_content'] = $LNG['a_edit_edited'];
}
else {
$this->form();
}
}
}
?>
alexander7070
Advanced Member
 
Posts: 51
Joined: 2007-02-28 02:37 pm

Re: Problem with 5.2.0.

Postby alexander7070 » 2008-01-10 11:51 am

Following these changes, the site is not even included in the top
alexander7070
Advanced Member
 
Posts: 51
Joined: 2007-02-28 02:37 pm

Re: Problem with 5.2.0.

Postby Jeremy » 2008-01-10 04:24 pm

sorry... ok, i'm going to try again:
Code: Select all
        list($TMPL['email'], $active_old) = $DB->fetch("SELECT email, active FROM {$CONF['sql_prefix']}_sites WHERE username = '{$TMPL['username']}'", __FILE__, __LINE__);
          if ($active_old == 0 && $TMPL['active'] == 1) {
          if ($CONF['google_friendly_links']) {
            $TMPL['verbose_link'] = "";
          }
          else {
            $TMPL['verbose_link'] = "index.php?a=in&u={$TMPL['username']}";
          }
          $TMPL['link_code'] = $this->do_skin('link_code');

          $LNG['join_welcome'] = sprintf($LNG['join_welcome'], $TMPL['list_name']);

          $join_email = new skin('join_email');
          $join_email->send_email($TMPL['email']);
        }
Jeremy
Supreme Diety
 
Posts: 8922
Joined: 2003-05-05 04:41 pm
Location: NJ, USA

Re: Problem with 5.2.0.

Postby alexander7070 » 2008-01-11 02:08 am

Thank you very much! Now everything works. Here is the full text file

<?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 edit extends join_edit {
function edit() {
global $CONF, $DB, $FORM, $LNG, $TMPL;

$TMPL['header'] = $LNG['a_edit_header'];

$TMPL['error_username'] = '';
$TMPL['error_style_username'] = '';
$TMPL['error_password'] = '';
$TMPL['error_style_password'] = '';
$TMPL['error_url'] = '';
$TMPL['error_style_url'] = '';
$TMPL['error_email'] = '';
$TMPL['error_style_email'] = '';
$TMPL['error_title'] = '';
$TMPL['error_style_title'] = '';
$TMPL['error_banner_url'] = '';
$TMPL['error_style_banner_url'] = '';
$TMPL['error_captcha'] = '';
$TMPL['error_style_captcha'] = '';

$TMPL['username'] = $DB->escape($FORM['u']);
list($check) = $DB->fetch("SELECT 1 FROM {$CONF['sql_prefix']}_sites WHERE username = '{$TMPL['username']}'", __FILE__, __LINE__);
if ($check) {
if (!isset($FORM['submit'])) {
$this->form();
}
else {
$this->process();
}
}
else {
$this->error($LNG['g_invalid_u'], 'admin');
}
}

function form() {
global $CONF, $DB, $LNG, $TMPL;

if (!isset($TMPL['url'])) {
$row = $DB->fetch("SELECT * FROM {$CONF['sql_prefix']}_sites WHERE username = '{$TMPL['username']}'", __FILE__, __LINE__);
$TMPL = array_merge($TMPL, $row);
}
else {
if (isset($TMPL['url'])) { $TMPL['url'] = stripslashes($TMPL['url']); }
if (isset($TMPL['title'])) { $TMPL['title'] = stripslashes($TMPL['title']); }
if (isset($TMPL['description'])) { $TMPL['description'] = stripslashes($TMPL['description']); }
if (isset($TMPL['category'])) { $TMPL['category'] = stripslashes($TMPL['category']); }
if (isset($TMPL['banner_url'])) { $TMPL['banner_url'] = stripslashes($TMPL['banner_url']); }
if (isset($TMPL['email'])) { $TMPL['email'] = stripslashes($TMPL['email']); }
}

$TMPL['categories_menu'] = "<select name=\"category\">\n";
foreach ($CONF['categories'] as $cat => $skin) {
if ($TMPL['category'] == $cat) {
$TMPL['categories_menu'] .= "<option value=\"{$cat}\" selected=\"selected\">{$cat}</option>\n";
}
else {
$TMPL['categories_menu'] .= "<option value=\"{$cat}\">{$cat}</option>\n";
}
}
$TMPL['categories_menu'] .= '</select>';

$TMPL['active_menu'] = "<select name=\"active\">\n";
if ($TMPL['active'] == 1) {
$TMPL['active_menu'] .= "<option value=\"1\" selected=\"selected\">{$LNG['a_edit_active']}</option>\n<option value=\"0\">{$LNG['a_edit_inactive']}</option>\n";
}
else {
$TMPL['active_menu'] .= "<option value=\"1\">{$LNG['a_edit_active']}</option>\n<option value=\"0\" selected=\"selected\">{$LNG['a_edit_inactive']}</option>\n";
}
$TMPL['active_menu'] .= '</select>';

if ($CONF['max_banner_width'] && $CONF['max_banner_height']) {
$TMPL['join_banner_size'] = sprintf($LNG['join_banner_size'], $CONF['max_banner_width'], $CONF['max_banner_height']);
}
else {
$TMPL['join_banner_size'] = '';
}

$TMPL['url'] = htmlspecialchars($TMPL['url']);
$TMPL['title'] = htmlspecialchars($TMPL['title']);
$TMPL['description'] = htmlspecialchars($TMPL['description']);
$TMPL['banner_url'] = htmlspecialchars($TMPL['banner_url']);
$TMPL['email'] = htmlspecialchars($TMPL['email']);

$TMPL['admin_content'] = <<<EndHTML
<form action="{$TMPL['list_url']}/index.php?a=admin&amp;b=edit&amp;u={$TMPL['username']}" method="post">
<fieldset>
<legend>{$LNG['join_website']}</legend>
<div class="{$TMPL['error_style_url']}"><label>{$LNG['g_url']}<br />
<input type="text" name="url" size="50" value="{$TMPL['url']}" />
{$TMPL['error_url']}
</label></div><br />
<div class="{$TMPL['error_style_title']}"><label>{$LNG['g_title']}<br />
<input type="text" name="title" size="50" value="{$TMPL['title']}" />
{$TMPL['error_title']}
</label></div><br />
<label>{$LNG['g_description']}<br />
<textarea cols="40" rows="5" name="description">{$TMPL['description']}</textarea><br /><br />
</label>
<label>{$LNG['g_category']}<br />
{$TMPL['categories_menu']}<br /><br />
</label>
<div class="{$TMPL['error_style_banner_url']}"><label>{$LNG['g_banner_url']} {$TMPL['join_banner_size']}<br />
<input type="text" name="banner_url" size="50" value="{$TMPL['banner_url']}" />
{$TMPL['error_banner_url']}
</label></div><br />
<div class="{$TMPL['error_style_email']}"><label>{$LNG['g_email']}<br />
<input type="text" name="email" size="50" value="{$TMPL['email']}" />
{$TMPL['error_email']}
</label></div>
</fieldset>

<fieldset>
<legend>{$LNG['join_user']}</legend>
<label>{$LNG['g_password']} - {$LNG['edit_password_blank']}<br />
<input type="password" name="password" size="20" /><br /><br />
</label>
<label>{$LNG['a_edit_site_is']}<br />
{$TMPL['active_menu']}<br /><br />
</label>
<input name="submit" type="submit" value="{$LNG['a_edit_header']}" />
</fieldset>
</form>
EndHTML;
}

function process() {
global $CONF, $DB, $FORM, $LNG, $TMPL;

$TMPL['url'] = $DB->escape($FORM['url']);
$TMPL['title'] = $DB->escape($FORM['title']);
$TMPL['description'] = $DB->escape($FORM['description']);
$TMPL['category'] = $DB->escape($FORM['category']);
$TMPL['banner_url'] = $DB->escape($FORM['banner_url']);
$TMPL['email'] = $DB->escape($FORM['email']);
$TMPL['active'] = intval($FORM['active']);

if ($this->check_input('edit')) {
if ($FORM['password']) {
$password = md5($FORM['password']);
$password_sql = ", password = '{$password}'";
}
else {
$password_sql = '';
}

require_once("{$CONF['path']}/sources/in.php");
$short_url = in::short_url($TMPL['url']);
list($TMPL['email'], $active_old) = $DB->fetch("SELECT email, active FROM {$CONF['sql_prefix']}_sites WHERE username = '{$TMPL['username']}'", __FILE__, __LINE__);
if ($active_old == 0 && $TMPL['active'] == 1) {
if ($CONF['google_friendly_links']) {
$TMPL['verbose_link'] = "";
}
else {
$TMPL['verbose_link'] = "index.php?a=in&u={$TMPL['username']}";
}
$TMPL['link_code'] = $this->do_skin('link_code');

$LNG['join_welcome'] = sprintf($LNG['join_welcome'], $TMPL['list_name']);

$join_email = new skin('join_email');
$join_email->send_email($TMPL['email']);
}

$DB->query("UPDATE {$CONF['sql_prefix']}_sites SET url = '{$TMPL['url']}', short_url = '{$short_url}', title = '{$TMPL['title']}', description = '{$TMPL['description']}', category = '{$TMPL['category']}', banner_url = '{$TMPL['banner_url']}', email = '{$TMPL['email']}', active = {$TMPL['active']}{$password_sql} WHERE username = '{$TMPL['username']}'", __FILE__, __LINE__);

$TMPL['admin_content'] = $LNG['a_edit_edited'];
}
else {
$this->form();
}
}
}
?>
alexander7070
Advanced Member
 
Posts: 51
Joined: 2007-02-28 02:37 pm


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron