Ejemplo n.º 1
0
Collective members growth rate:
</td><td>
<?php 
echo $collective_fans_growth_rate;
?>
 members/day
</td></tr>

</table>

<?php 
$owned = get_owned('current');
$header = true;
foreach ($owned as $id) {
    $info = get_listing_info($id);
    $stats = get_listing_stats($id);
    // now check $lastupdated -- if more than 8 weeks ago, notify!
    $weeks = 0;
    if ($stats['lastupdated'] && date('Y') != date('Y', strtotime($stats['lastupdated']))) {
        $weeks = 52 - date('W', strtotime($stats['lastupdated'])) + date('W');
    } else {
        if ($stats['lastupdated']) {
            $weeks = date('W') - date('W', strtotime($stats['lastupdated']));
        }
    }
    if ($stats['lastupdated'] == '' || $weeks >= 8) {
        if ($header) {
            ?>
         <h2>Neglected Listings Notification</h2>
         <p>The following listings have gone on two months without a 
         newly-approved member or a new/updated affiliate!</p>
Ejemplo n.º 2
0
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.

 For more information please view the readme.txt file.
******************************************************************************/
require 'config.php';
require_once 'mod_errorlogs.php';
require_once 'mod_owned.php';
require_once 'mod_categories.php';
require_once 'mod_members.php';
require_once 'mod_settings.php';
$info = get_listing_info($listing);
$stats = get_listing_stats($listing, true);
// prepare date format
if ($stats['lastupdated']) {
    $stats['lastupdated'] = @date(get_setting('date_format'), strtotime($stats['lastupdated']));
} else {
    $stats['lastupdated'] = 'No updates available.';
}
// new members?
if (isset($stats['newmembers']) && $stats['newmembers'] == '') {
    $stats['newmembers'] = 'No new members.';
}
// find categories this is listed under (collective cats)
$cats = '';
$i = 0;
$catsarray = explode('|', $info['catid']);
foreach ($catsarray as $index => $c) {
Ejemplo n.º 3
0
function parse_owned_template($id)
{
    require 'config.php';
    $db_link = mysql_connect($db_server, $db_user, $db_password) or die(DATABASE_CONNECT_ERROR . mysql_error());
    mysql_select_db($db_database) or die(DATABASE_CONNECT_ERROR . mysql_error());
    // get date setting
    $query = "SELECT `value` FROM `{$db_settings}` WHERE " . "`setting` = 'date_format'";
    $result = mysql_query($query);
    if (!$result) {
        log_error(__FILE__ . ':' . __LINE__, 'Error executing query: <i>' . mysql_error() . '</i>; Query is: <code>' . $query . '</code>');
        die(STANDARD_ERROR);
    }
    $datesetting = mysql_fetch_array($result);
    $dateformat = $datesetting['value'];
    // get info
    $query = "SELECT * FROM `{$db_owned}` WHERE `listingid` = '{$id}'";
    $result = mysql_query($query);
    if (!$result) {
        log_error(__FILE__ . ':' . __LINE__, 'Error executing query: <i>' . mysql_error() . '</i>; Query is: <code>' . $query . '</code>');
        die(STANDARD_ERROR);
    }
    $info = mysql_fetch_array($result);
    // find categories this is listed under (collective cats)
    $cats = '';
    $i = 0;
    $catsarray = explode('|', $info['catid']);
    foreach ($catsarray as $index => $c) {
        if ($c == '') {
            $i++;
            continue;
        }
        // blank
        if ($i == count($catsarray) - 1 && count($catsarray) != 1) {
            $cats .= 'and ';
        }
        $cat = '';
        $aline = get_ancestors($c);
        foreach ($aline as $a) {
            $cat = get_category_name($a) . ' > ' . $cat;
        }
        $cat = rtrim($cat, '> ');
        $cat = str_replace('>', '&raquo;', $cat);
        $cats .= "{$cat}, ";
        $i++;
    }
    $cats = rtrim($cats, ', ');
    $query = "SELECT `setting`, `value` FROM `{$db_settings}` WHERE `setting` " . '= "owned_images_dir" OR `setting` = "root_path_absolute" OR ' . '`setting` = "root_path_web"';
    $result = mysql_query($query);
    if (!$result) {
        log_error(__FILE__ . ':' . __LINE__, 'Error executing query: <i>' . mysql_error() . '</i>; Query is: <code>' . $query . '</code>');
        die(STANDARD_ERROR);
    }
    $dir = '';
    $root_web = '';
    $root_abs = '';
    while ($row = mysql_fetch_array($result)) {
        if ($row['setting'] == 'owned_images_dir') {
            $dir = $row['value'];
        } else {
            if ($row['setting'] == 'root_path_absolute') {
                $root_abs = $row['value'];
            } else {
                $root_web = $row['value'];
            }
        }
    }
    $image = $info['imagefile'] && is_file($dir . $info['imagefile']) ? getimagesize($dir . $info['imagefile']) : array('', '', '');
    // make sure $image is an array, in case getimagesize() failed
    if (!is_array($image)) {
        $image = array();
    }
    $dir = str_replace($root_abs, $root_web, $dir);
    $query = "SELECT `value` FROM `{$db_settings}` WHERE `setting` = " . "'owned_template'";
    $result = mysql_query($query);
    if (!$result) {
        log_error(__FILE__ . ':' . __LINE__, 'Error executing query: <i>' . mysql_error() . '</i>; Query is: <code>' . $query . '</code>');
        die(STANDARD_ERROR);
    }
    $setting = mysql_fetch_array($result);
    // get listing stats now
    $stats = get_listing_stats($info['listingid']);
    $formatted = str_replace('enth3-url', $info['url'], $setting['value']);
    $formatted = str_replace('enth3-subject', $info['subject'], $formatted);
    $formatted = str_replace('enth3-title', $info['title'], $formatted);
    $formatted = str_replace('enth3-desc', $info['desc'], $formatted);
    $formatted = str_replace('enth3-image', $dir . $info['imagefile'], $formatted);
    if (count($image)) {
        $formatted = str_replace('enth3-width', $image[0], $formatted);
        $formatted = str_replace('enth3-height', $image[1], $formatted);
    }
    $formatted = str_replace('enth3-categories', $cats, $formatted);
    $formatted = str_replace('enth3-listingtype', $info['listingtype'], $formatted);
    $formatted = str_replace('enth3-desc', $info['desc'], $formatted);
    $formatted = @str_replace('enth3-opened', date($dateformat, strtotime($info['opened'])), $formatted);
    $formatted = @str_replace('enth3-updated', date($dateformat, strtotime($stats['lastupdated'])), $formatted);
    $formatted = str_replace('enth3-pending', $stats['pending'], $formatted);
    $formatted = str_replace('enth3-approved', $stats['total'], $formatted);
    $formatted = str_replace('enth3-status', $info['status'], $formatted);
    $formatted = str_replace('enth3-growth', $stats['average'], $formatted);
    $formatted = str_replace('enth3-countries', $stats['countries'], $formatted);
    $formatted = str_replace('enth3-newmembers', $stats['new_members'], $formatted);
    // deprecated, mostly here for scaling down
    $formatted = str_replace('enth3-cat', $cats, $formatted);
    return $formatted;
}