Welcome to Geeklog, Anonymous Saturday, December 21 2024 @ 07:25 am EST

Geeklog Forums

Google Sitemaps


Status: offline

Chrispcritters

Forum User
Chatty
Registered: 05/11/05
Posts: 49
Location:Tustin, CA
I'd like to see an implementation entirely within Geeklog that would support Google Sitemaps for Articles, Static Pages, and the Forums.
 Quote

Status: offline

sakata

Forum User
Junior
Registered: 12/17/01
Posts: 25
Location:Japan
As for Google Sitemaps.
I want to store rss in root folder that let google bot can find rss easily.
Also, can we make the default rss file to index.xml?

 Quote

Status: offline

beewee

Forum User
Full Member
Registered: 08/05/03
Posts: 969
Location:The Netherlands, where else?
Quote by sakata: As for Google Sitemaps.
I want to store rss in root folder that let google bot can find rss easily.
Also, can we make the default rss file to index.xml?


You could make a URL_rewrite rule in your .htaccess file to point Google to the right file.

It might be nice if the content syndication option also would support the Google Sitemaps formatting, but making a proper Google Sitemap is more than only the XML, you also have to set the importance of stories etc.
Dutch Geeklog sites about camping/hiking:
www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by sakata: I want to store rss in root folder that let google bot can find rss easily.

You can have that by simply changing the path for $_CONF['rdf_file'] in your config.php. Note that only the path is used from that variable - the file name comes from the Admin's Content Syndication panel.

You would, however, have to make your site's root directory writable - something that doesn't sound like a good idea from a security point of view.

What is the problem with having the feed file elsewhere? There sure must be ways to tell Googlebot where to find it.


Quote by sakata: Also, can we make the default rss file to index.xml?

You can name it anything you want. See "Content Syndication".

bye, Dirk
 Quote

Archy

Anonymous
Hi all! 8)

2 questions:

1. How to create list of /mediagallery/ pages to sitemap.xml ?
2. How to auto-convert sitemap.xml to sitemap.html ?
 Quote

Annyk

Anonymous
O! Yea! We have great file - sitemap.php, but it's withous /mediagallery/ pages! Frown
Can you add code for Mediagallery plugin? PLEASE!!!!!!!!
<?php
// +---------------------------------------------------------------------------+
// | siteindex.php |
// | This is a event index page made especially for googlebots. |
// +---------------------------------------------------------------------------|
// | Copyright (C) 2002 by the following authors: |
// | Tom Willett - twillett@users.sourceforge.net |
// | Lee Whitworth - lwhitworth@users.sourceforge.net |
// +---------------------------------------------------------------------------|
// | 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. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA|
// | |
// +---------------------------------------------------------------------------|
require_once('lib-common.php'Wink;


$perpage = 75;

$display = COM_siteHeader('none'Wink;

$display .= '<h1 style="padding-left:10px;">Карта сайта</h1><div style="padding-left:10px;">';

$sql = "SELECT *,unix_timestamp(date) AS day FROM {$_TABLES['stories']} WHERE (date <= NOW()) AND (draft_flag = 0)";
$sql .= " AND (";
if (!empty ($_USER['uid'])) {
$groupList = '';
foreach ($_GROUPS as $grp) {
$groupList .= $grp . ',';
}
$groupList = substr ($groupList, 0, -1);
$sql .= "(owner_id = {$_USER['uid']} AND perm_owner >= 2) OR ";
$sql .= "(group_id IN ($groupList) AND perm_group >= 2) OR ";
$sql .= "(perm_members >= 2) OR ";
}
$sql .= "(perm_anon >= 2))";

if (empty($page)) {

$page = 1;
}

$offset = ($page -1) * $perpage;

$order = " ORDER BY sid DESC LIMIT $offset, $perpage";

$recs = DB_query($sql . $order);
$nrows = DB_numRows($recs);

$display .= '<table width="100%"><tr><td>Раздел</td><td>Название</td></tr>';

for ($x = 0; $x < $nrows; $x++) {
$A = DB_fetchArray($recs);
$display .= '<tr><td>' . $A['tid'] . '</td>';
$display .= '<td>';
$display .= '<a href="' . $_CONF['site_url'] . '/article.php?story=' . $A['sid'] . '">'
. stripslashes($A['title']) . '</a>';
$display .='</td></tr>';

}

$display .= '</table><p>';

$countsql = "SELECT count(*) as count FROM {$_TABLES['stories']} WHERE (date <= NOW()) AND (draft_flag = 0)";
$countsql .= " AND (";
if (!empty ($_USER['uid'])) {

$countsql .= "(owner_id = {$_USER['uid']} AND perm_owner >= 2) OR ";
$countsql .= "(group_id IN ($groupList) AND perm_group >= 2) OR ";
$countsql .= "(perm_members >= 2) OR ";
}
$countsql .= "(perm_anon >= 2))";

$data = DB_query($countsql);
$D = DB_fetchArray($data);
$num_pages = ceil($D['count'] / $perpage);

$base_url = $_CONF['site_url'] . '/siteindex.php';
$display .= COM_printPageNavigation($base_url,$page, $num_pages);
$display .= '</p>';

// +---------------------------------------------------------------------------+
// | eventindex.php |
// | This is a event index page made especially for googlebots. |
// +---------------------------------------------------------------------------|
// | Copyright (C) 2002 by the following authors: |
// | Tom Willett - twillett@users.sourceforge.net |
// | Lee Whitworth - lwhitworth@users.sourceforge.net |
// +---------------------------------------------------------------------------|
// | 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. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA|
// | |
// +---------------------------------------------------------------------------|

//$display .= '<h1>Event Index</h1>';

//$sql = "SELECT *,unix_timestamp(eid) AS day FROM {$_TABLES['events']} WHERE (datestart >= NOW())";
//$sql .= " AND (";
//if (!empty ($_USER['uid'])) {
// $groupList = '';
// foreach ($_GROUPS as $grp) {
// $groupList .= $grp . ',';
// }
// $groupList = substr ($groupList, 0, -1);
// $sql .= "(owner_id = {$_USER['uid']} AND perm_owner >= 2) OR ";
// $sql .= "(group_id IN ($groupList) AND perm_group >= 2) OR ";
// $sql .= "(perm_members >= 2) OR ";
//}
//$sql .= "(perm_anon >= 2))";

//if (empty($page)) {
// // If no page sent then assume the first.
// $page = 1;
//}
//
//$offset = ($page -1) * $perpage;
//
//$order = " ORDER BY eid DESC LIMIT $offset, $perpage";
//
//$recs = DB_query($sql . $order);
//$nrows = DB_numRows($recs);
//
//$display .= '<table width="100%"><tr><td><b>EID</b></td><td><b>Title</b></td><td><b>Type</b></td><td><b>Start</b></td><td><b>End</b></td></tr>';
//
//for ($x = 0; $x < $nrows; $x++) {
// $A = DB_fetchArray($recs);
// $display .= '<tr><td>' . $A['eid'] . '</td>';
// $display .= '<td>';
// $display .= '<a href="' . $_CONF['site_url'] . '/calendar_event.php?mode=&eid=' . $A['eid'] . '">'
// . stripslashes($A['title']) . '</a>';
// $display .= '</td>' . '<td>' . $A['event_type'] . '</td>';
// $display .= '<td>' . $A['datestart'] . '<br>' . $A['timestart'] . '</td>';
// $display .= '<td>' . $A['dateend'] . '<br>' . $A['timeend'] . '</td></tr>';
//}
//
//$display .= '</table><p>';
//
//$countsql = "SELECT count(*) as count FROM {$_TABLES['events']} WHERE (datestart >= NOW())";
//$countsql .= " AND (";
//if (!empty ($_USER['uid'])) {
// // Note: $groupList re-used from above
// $countsql .= "(owner_id = {$_USER['uid']} AND perm_owner >= 2) OR ";
// $countsql .= "(group_id IN ($groupList) AND perm_group >= 2) OR ";
// $countsql .= "(perm_members >= 2) OR ";
//}
//$countsql .= "(perm_anon >= 2))";
//
//$data = DB_query($countsql);
//$D = DB_fetchArray($data);
//$num_pages = ceil($D['count'] / $perpage);
//
// // Print Google-like paging navigation
//$base_url = $_CONF['site_url'] . '/eventindex.php';
//$display .= COM_printPageNavigation($base_url,$page, $num_pages);
//$display .= '</p>';
//
// +---------------------------------------------------------------------------+
// | linkindex.php |
// | This is a link index page made especially for googlebots. |
// +---------------------------------------------------------------------------|
// | Copyright (C) 2002 by the following authors: |
// | Tom Willett - twillett@users.sourceforge.net |
// | Lee Whitworth - lwhitworth@users.sourceforge.net |
// +---------------------------------------------------------------------------|
// | 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. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA|
// | |
// +---------------------------------------------------------------------------|

$display .= '<h2>Ссылки</h2>';

$sql = "SELECT *,unix_timestamp(date) AS day FROM {$_TABLES['links']} WHERE (date <= NOW())";
$sql .= " AND (";
if (!empty ($_USER['uid'])) {
$groupList = '';
foreach ($_GROUPS as $grp) {
$groupList .= $grp . ',';
}
$groupList = substr ($groupList, 0, -1);
$sql .= "(owner_id = {$_USER['uid']} AND perm_owner >= 2) OR ";
$sql .= "(group_id IN ($groupList) AND perm_group >= 2) OR ";
$sql .= "(perm_members >= 2) OR ";
}
$sql .= "(perm_anon >= 2))";

if (empty($page)) {
// If no page sent then assume the first.
$page = 1;
}

$offset = ($page -1) * $perpage;

$order = " ORDER BY lid DESC LIMIT $offset, $perpage";

$recs = DB_query($sql . $order);
$nrows = DB_numRows($recs);

$display .= '<table width="100%"><tr><td><b>Название</b></td><td><b>Ссылка</b></td><td><b>Кликов</b></td></tr>';

for ($x = 0; $x < $nrows; $x++) {
$A = DB_fetchArray($recs);
$display .= '<tr><td>' . $A['title'] . '</td>';
$display .= '<td>';
$display .= '<a href="' . $A['url'] . '">'
. $A['url'] . '</a>';
$display .='</td>' . '<td>' . $A['hits'] . '</td></tr>';

}

$display .= '</table><p>';

$countsql = "SELECT count(*) as count FROM {$_TABLES['links']} WHERE (date <= NOW())";
$countsql .= " AND (";
if (!empty ($_USER['uid'])) {
// Note: $groupList re-used from above
$countsql .= "(owner_id = {$_USER['uid']} AND perm_owner >= 2) OR ";
$countsql .= "(group_id IN ($groupList) AND perm_group >= 2) OR ";
$countsql .= "(perm_members >= 2) OR ";
}
$countsql .= "(perm_anon >= 2))";

$data = DB_query($countsql);
$D = DB_fetchArray($data);
$num_pages = ceil($D['count'] / $perpage);

// Print Google-like paging navigation
$base_url = $_CONF['site_url'] . '/linkindex.php';
$display .= COM_printPageNavigation($base_url,$page, $num_pages);
$display .= '</p>';

// +---------------------------------------------------------------------------+
// | pageindex.php |
// | This is a index page for Tom's Staticpages 1.2 made especially for |
// | googlebots. Only works with Staticpages 1.2! |
// +---------------------------------------------------------------------------|
// | Copyright (C) 2002 by the following authors: |
// | Tom Willett - twillett@users.sourceforge.net |
// | Lee Whitworth - lwhitworth@users.sourceforge.net |
// +---------------------------------------------------------------------------|
// | 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. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA|
// | |
// +---------------------------------------------------------------------------|

//$display .= '<div align="center"><p><h1>Page Index<h1></div>';

//$sql = "SELECT *,unix_timestamp(sp_date) AS day FROM {$_TABLES['staticpage']} WHERE (sp_date <= NOW())";
//$sql .= " AND (";
//if (!empty ($_USER['uid'])) {
// $groupList = '';
// foreach ($_GROUPS as $grp) {
// $groupList .= $grp . ',';
// }
// $groupList = substr ($groupList, 0, -1);
// $sql .= "(owner_id = {$_USER['uid']} AND perm_owner >= 2) OR ";
// $sql .= "(group_id IN ($groupList) AND perm_group >= 2) OR ";
// $sql .= "(perm_members >= 2) OR ";
//}
//$sql .= "(perm_anon >= 2))";
//
//if (empty($page)) {
// // If no page sent then assume the first.
// $page = 1;
//}
//
//$offset = ($page -1) * $perpage;
//
//$order = " ORDER BY sp_id DESC LIMIT $offset, $perpage";
//
//$recs = DB_query($sql . $order);
//$nrows = DB_numRows($recs);
//
//$display .= '<table width="100%"><tr><td><b>Date</b></td><td><b>Label</b></td><td><b>Title</b></td><td><b>Views</b></td></tr>';
//
//for ($x = 0; $x < $nrows; $x++) {
// $A = DB_fetchArray($recs);
// $display .= '<tr><td>' . $A['sp_date'] . '</td>';
// $display .= '<td>' . $A['sp_label'] . '</td>';
// $display .= '<td>';
// $display .= '<a href="' . $_CONF['site_url'] . '/staticpages/index.php?page=' . $A['sp_id'] . '">'
// . stripslashes($A['sp_title']) . '</a>';
// $display .='</td>' . '<td>' . $A['sp_hits'] . '</td></tr>';
//
//}
//
//$display .= '</table><p>';
//
//$countsql = "SELECT count(*) as count FROM {$_TABLES['staticpage']} WHERE (sp_date <= NOW())";
//$countsql .= " AND (";
//if (!empty ($_USER['uid'])) {
// // Note: $groupList re-used from above
// $countsql .= "(owner_id = {$_USER['uid']} AND perm_owner >= 2) OR ";
// $countsql .= "(group_id IN ($groupList) AND perm_group >= 2) OR ";
// $countsql .= "(perm_members >= 2) OR ";
//}
//$countsql .= "(perm_anon >= 2))";
//
//$data = DB_query($countsql);
//$D = DB_fetchArray($data);
//$num_pages = ceil($D['count'] / $perpage);
//
// Print Google-like paging navigation
//$base_url = $_CONF['site_url'] . '/pageindex.php';
//$display .= COM_printPageNavigation($base_url,$page, $num_pages);
//$display .= '</p>';

// +---------------------------------------------------------------------------+
// | voteindex.php |
// | This is a poll index page made especially for googlebots. |
// +---------------------------------------------------------------------------|
// | Copyright (C) 2002 by the following authors: |
// | Tom Willett - twillett@users.sourceforge.net |
// | Lee Whitworth - lwhitworth@users.sourceforge.net |
// +---------------------------------------------------------------------------|
// | 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. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA|
// | |
// +---------------------------------------------------------------------------|

$display .= '<h2>Опросы</h2>';

$sql = "SELECT *,unix_timestamp(date) AS day FROM {$_TABLES['pollquestions']} WHERE (date <= NOW())";
$sql .= " AND (";
if (!empty ($_USER['uid'])) {
$groupList = '';
foreach ($_GROUPS as $grp) {
$groupList .= $grp . ',';
}
$groupList = substr ($groupList, 0, -1);
$sql .= "(owner_id = {$_USER['uid']} AND perm_owner >= 2) OR ";
$sql .= "(group_id IN ($groupList) AND perm_group >= 2) OR ";
$sql .= "(perm_members >= 2) OR ";
}
$sql .= "(perm_anon >= 2))";

if (empty($page)) {
// If no page sent then assume the first.
$page = 1;
}

$offset = ($page -1) * $perpage;

$order = " ORDER BY date DESC LIMIT $offset, $perpage";

$recs = DB_query($sql . $order);
$nrows = DB_numRows($recs);

$display .= '<table width="100%"><tr><td><b>Вопрос</b></td><td><b>Высказалось</b></td></tr>';

for ($x = 0; $x < $nrows; $x++) {
$A = DB_fetchArray($recs);
$display .= '<tr><td>';
$display .= '<a href="' . $_CONF['site_url'] . '/pollbooth.php?qid=' . $A['qid'] . '">'
. $A['question'] . '</a>';
$display .='</td>' . '<td>' . $A['voters'] . '</td></tr>';
}

$display .= '</table><p>';

$countsql = "SELECT count(*) as count FROM {$_TABLES['pollquestions']} WHERE (date <= NOW())";
$countsql .= " AND (";
if (!empty ($_USER['uid'])) {
// Note: $groupList re-used from above
$countsql .= "(owner_id = {$_USER['uid']} AND perm_owner >= 2) OR ";
$countsql .= "(group_id IN ($groupList) AND perm_group >= 2) OR ";
$countsql .= "(perm_members >= 2) OR ";
}
$countsql .= "(perm_anon >= 2))";

$data = DB_query($countsql);
$D = DB_fetchArray($data);
$num_pages = ceil($D['count'] / $perpage);

// Print Google-like paging navigation
$base_url = $_CONF['site_url'] . '/voteindex.php';
$display .= COM_printPageNavigation($base_url,$page, $num_pages);
$display .= '</p></div>';

$display .= COM_siteFooter();
echo $display;
?>
 Quote

Status: offline

mevans

Forum User
Full Member
Registered: 02/08/04
Posts: 393
Location:Texas
Here is your script with Media Gallery added to it...

Text Formatted Code

<?php
// +---------------------------------------------------------------------------+
// | siteindex.php |
// | This is a event index page made especially for googlebots. |
// +---------------------------------------------------------------------------|
// | Copyright (C) 2002 by the following authors: |
// | Tom Willett - twillett@users.sourceforge.net |
// | Lee Whitworth - lwhitworth@users.sourceforge.net |
// +---------------------------------------------------------------------------|
// | 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. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA|
// | |
// +---------------------------------------------------------------------------|
require_once('lib-common.php');

function MGshowTree( $aid,$depth ) {
    global $_CONF, $_MG_CONF, $MG_albums, $level;

    if ( $MG_albums[$aid]->hidden == 1 && $MG_albums[$aid]->access != 3 ) {
        return;
    }

    $retval = '';
    $px = ($level - 1 ) * 15;

    if ( $MG_albums[$aid]->title != 'root album' && $MG_albums[$aid]->access > 0 ) {
        if ( $level == 1 && $depth != 1) {
            $retval .= '<p>';
        }

        if ( $depth == 0 ) {
            $retval .= '<tr><td><div style="margin-left:' . $px . 'px;"><a href="' . $_MG_CONF['site_url'] . '/album.php?aid=' . $MG_albums[$aid]->id . '&amp;page=1">' . strip_tags($MG_albums[$aid]->title) . '</a></div></td>';
            $retval .= '<td>' . $MG_albums[$aid]->media_count . '</td></tr>' . LB;
        } else {
            if ( $level <= $depth ) {
                $retval .= '<tr><td><div style="margin-left:' . $px . 'px;"><a href="' . $_MG_CONF['site_url'] . '/album.php?aid=' . $MG_albums[$aid]->id . '&amp;page=1">' . strip_tags($MG_albums[$aid]->title) . '</a></div></td>';
                $retval .= '<td>' . $MG_albums[$aid]->media_count . '</td></tr>'. LB;
            }
        }
    } else {
        if ($MG_albums[$aid]->id == 0 ) {
            $retval .= ''; // '<br>';
        }
    }

    if ( !empty($MG_albums[$aid]->children)) {
        $children = $MG_albums[$aid]->getChildren();
        foreach($children as $child) {
            $level++;
            $retval .= MGshowTree( $MG_albums[$child]->id,$depth ); // $MG_albums[$child]->showTree($depth);
            $level--;
        }
    }
    return $retval;
}

$perpage = 75;

$display = COM_siteHeader('none');

$display .= '<h1 style="padding-left:10px;">Карта сайта</h1><div style="padding-left:10px;">';

$sql = "SELECT *,unix_timestamp(date) AS day FROM {$_TABLES['stories']} WHERE (date <= NOW()) AND (draft_flag = 0)";
$sql .= " AND (";
if (!empty ($_USER['uid'])) {
$groupList = '';
foreach ($_GROUPS as $grp) {
$groupList .= $grp . ',';
}
$groupList = substr ($groupList, 0, -1);
$sql .= "(owner_id = {$_USER['uid']} AND perm_owner >= 2) OR ";
$sql .= "(group_id IN ($groupList) AND perm_group >= 2) OR ";
$sql .= "(perm_members >= 2) OR ";
}
$sql .= "(perm_anon >= 2))";

if (empty($page)) {

$page = 1;
}

$offset = ($page -1) * $perpage;

$order = " ORDER BY sid DESC LIMIT $offset, $perpage";

$recs = DB_query($sql . $order);
$nrows = DB_numRows($recs);

$display .= '<table width="100%"><tr><td>Раздел</td><td>Название</td></tr>';

for ($x = 0; $x < $nrows; $x++) {
$A = DB_fetchArray($recs);
$display .= '<tr><td>' . $A['tid'] . '</td>';
$display .= '<td>';
$display .= '<a href="' . $_CONF['site_url'] . '/article.php?story=' . $A['sid'] . '">'
. stripslashes($A['title']) . '</a>';
$display .='</td></tr>';

}

$display .= '</table><p>';

$countsql = "SELECT count(*) as count FROM {$_TABLES['stories']} WHERE (date <= NOW()) AND (draft_flag = 0)";
$countsql .= " AND (";
if (!empty ($_USER['uid'])) {

$countsql .= "(owner_id = {$_USER['uid']} AND perm_owner >= 2) OR ";
$countsql .= "(group_id IN ($groupList) AND perm_group >= 2) OR ";
$countsql .= "(perm_members >= 2) OR ";
}
$countsql .= "(perm_anon >= 2))";

$data = DB_query($countsql);
$D = DB_fetchArray($data);
$num_pages = ceil($D['count'] / $perpage);

$base_url = $_CONF['site_url'] . '/siteindex.php';
$display .= COM_printPageNavigation($base_url,$page, $num_pages);
$display .= '</p>';

// +---------------------------------------------------------------------------+
// | eventindex.php |
// | This is a event index page made especially for googlebots. |
// +---------------------------------------------------------------------------|
// | Copyright (C) 2002 by the following authors: |
// | Tom Willett - twillett@users.sourceforge.net |
// | Lee Whitworth - lwhitworth@users.sourceforge.net |
// +---------------------------------------------------------------------------|
// | 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. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA|
// | |
// +---------------------------------------------------------------------------|

//$display .= '<h1>Event Index</h1>';

//$sql = "SELECT *,unix_timestamp(eid) AS day FROM {$_TABLES['events']} WHERE (datestart >= NOW())";
//$sql .= " AND (";
//if (!empty ($_USER['uid'])) {
// $groupList = '';
// foreach ($_GROUPS as $grp) {
// $groupList .= $grp . ',';
// }
// $groupList = substr ($groupList, 0, -1);
// $sql .= "(owner_id = {$_USER['uid']} AND perm_owner >= 2) OR ";
// $sql .= "(group_id IN ($groupList) AND perm_group >= 2) OR ";
// $sql .= "(perm_members >= 2) OR ";
//}
//$sql .= "(perm_anon >= 2))";

//if (empty($page)) {
// // If no page sent then assume the first.
// $page = 1;
//}
//
//$offset = ($page -1) * $perpage;
//
//$order = " ORDER BY eid DESC LIMIT $offset, $perpage";
//
//$recs = DB_query($sql . $order);
//$nrows = DB_numRows($recs);
//
//$display .= '<table width="100%"><tr><td><b>EID</b></td><td><b>Title</b></td><td><b>Type</b></td><td><b>Start</b></td><td><b>End</b></td></tr>';
//
//for ($x = 0; $x < $nrows; $x++) {
// $A = DB_fetchArray($recs);
// $display .= '<tr><td>' . $A['eid'] . '</td>';
// $display .= '<td>';
// $display .= '<a href="' . $_CONF['site_url'] . '/calendar_event.php?mode=&eid=' . $A['eid'] . '">'
// . stripslashes($A['title']) . '</a>';
// $display .= '</td>' . '<td>' . $A['event_type'] . '</td>';
// $display .= '<td>' . $A['datestart'] . '<br>' . $A['timestart'] . '</td>';
// $display .= '<td>' . $A['dateend'] . '<br>' . $A['timeend'] . '</td></tr>';
//}
//
//$display .= '</table><p>';
//
//$countsql = "SELECT count(*) as count FROM {$_TABLES['events']} WHERE (datestart >= NOW())";
//$countsql .= " AND (";
//if (!empty ($_USER['uid'])) {
// // Note: $groupList re-used from above
// $countsql .= "(owner_id = {$_USER['uid']} AND perm_owner >= 2) OR ";
// $countsql .= "(group_id IN ($groupList) AND perm_group >= 2) OR ";
// $countsql .= "(perm_members >= 2) OR ";
//}
//$countsql .= "(perm_anon >= 2))";
//
//$data = DB_query($countsql);
//$D = DB_fetchArray($data);
//$num_pages = ceil($D['count'] / $perpage);
//
// // Print Google-like paging navigation
//$base_url = $_CONF['site_url'] . '/eventindex.php';
//$display .= COM_printPageNavigation($base_url,$page, $num_pages);
//$display .= '</p>';
//
// +---------------------------------------------------------------------------+
// | linkindex.php |
// | This is a link index page made especially for googlebots. |
// +---------------------------------------------------------------------------|
// | Copyright (C) 2002 by the following authors: |
// | Tom Willett - twillett@users.sourceforge.net |
// | Lee Whitworth - lwhitworth@users.sourceforge.net |
// +---------------------------------------------------------------------------|
// | 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. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA|
// | |
// +---------------------------------------------------------------------------|

$display .= '<h2>Ссылки</h2>';

$sql = "SELECT *,unix_timestamp(date) AS day FROM {$_TABLES['links']} WHERE (date <= NOW())";
$sql .= " AND (";
if (!empty ($_USER['uid'])) {
$groupList = '';
foreach ($_GROUPS as $grp) {
$groupList .= $grp . ',';
}
$groupList = substr ($groupList, 0, -1);
$sql .= "(owner_id = {$_USER['uid']} AND perm_owner >= 2) OR ";
$sql .= "(group_id IN ($groupList) AND perm_group >= 2) OR ";
$sql .= "(perm_members >= 2) OR ";
}
$sql .= "(perm_anon >= 2))";

if (empty($page)) {
// If no page sent then assume the first.
$page = 1;
}

$offset = ($page -1) * $perpage;

$order = " ORDER BY lid DESC LIMIT $offset, $perpage";

$recs = DB_query($sql . $order);
$nrows = DB_numRows($recs);

$display .= '<table width="100%"><tr><td><b>Название</b></td><td><b>Ссылка</b></td><td><b>Кликов</b></td></tr>';

for ($x = 0; $x < $nrows; $x++) {
$A = DB_fetchArray($recs);
$display .= '<tr><td>' . $A['title'] . '</td>';
$display .= '<td>';
$display .= '<a href="' . $A['url'] . '">'
. $A['url'] . '</a>';
$display .='</td>' . '<td>' . $A['hits'] . '</td></tr>';

}

$display .= '</table><p>';

$countsql = "SELECT count(*) as count FROM {$_TABLES['links']} WHERE (date <= NOW())";
$countsql .= " AND (";
if (!empty ($_USER['uid'])) {
// Note: $groupList re-used from above
$countsql .= "(owner_id = {$_USER['uid']} AND perm_owner >= 2) OR ";
$countsql .= "(group_id IN ($groupList) AND perm_group >= 2) OR ";
$countsql .= "(perm_members >= 2) OR ";
}
$countsql .= "(perm_anon >= 2))";

$data = DB_query($countsql);
$D = DB_fetchArray($data);
$num_pages = ceil($D['count'] / $perpage);

// Print Google-like paging navigation
$base_url = $_CONF['site_url'] . '/linkindex.php';
$display .= COM_printPageNavigation($base_url,$page, $num_pages);
$display .= '</p>';

// +---------------------------------------------------------------------------+
// | pageindex.php |
// | This is a index page for Tom's Staticpages 1.2 made especially for |
// | googlebots. Only works with Staticpages 1.2! |
// +---------------------------------------------------------------------------|
// | Copyright (C) 2002 by the following authors: |
// | Tom Willett - twillett@users.sourceforge.net |
// | Lee Whitworth - lwhitworth@users.sourceforge.net |
// +---------------------------------------------------------------------------|
// | 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. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA|
// | |
// +---------------------------------------------------------------------------|

//$display .= '<div align="center"><p><h1>Page Index<h1></div>';

//$sql = "SELECT *,unix_timestamp(sp_date) AS day FROM {$_TABLES['staticpage']} WHERE (sp_date <= NOW())";
//$sql .= " AND (";
//if (!empty ($_USER['uid'])) {
// $groupList = '';
// foreach ($_GROUPS as $grp) {
// $groupList .= $grp . ',';
// }
// $groupList = substr ($groupList, 0, -1);
// $sql .= "(owner_id = {$_USER['uid']} AND perm_owner >= 2) OR ";
// $sql .= "(group_id IN ($groupList) AND perm_group >= 2) OR ";
// $sql .= "(perm_members >= 2) OR ";
//}
//$sql .= "(perm_anon >= 2))";
//
//if (empty($page)) {
// // If no page sent then assume the first.
// $page = 1;
//}
//
//$offset = ($page -1) * $perpage;
//
//$order = " ORDER BY sp_id DESC LIMIT $offset, $perpage";
//
//$recs = DB_query($sql . $order);
//$nrows = DB_numRows($recs);
//
//$display .= '<table width="100%"><tr><td><b>Date</b></td><td><b>Label</b></td><td><b>Title</b></td><td><b>Views</b></td></tr>';
//
//for ($x = 0; $x < $nrows; $x++) {
// $A = DB_fetchArray($recs);
// $display .= '<tr><td>' . $A['sp_date'] . '</td>';
// $display .= '<td>' . $A['sp_label'] . '</td>';
// $display .= '<td>';
// $display .= '<a href="' . $_CONF['site_url'] . '/staticpages/index.php?page=' . $A['sp_id'] . '">'
// . stripslashes($A['sp_title']) . '</a>';
// $display .='</td>' . '<td>' . $A['sp_hits'] . '</td></tr>';
//
//}
//
//$display .= '</table><p>';
//
//$countsql = "SELECT count(*) as count FROM {$_TABLES['staticpage']} WHERE (sp_date <= NOW())";
//$countsql .= " AND (";
//if (!empty ($_USER['uid'])) {
// // Note: $groupList re-used from above
// $countsql .= "(owner_id = {$_USER['uid']} AND perm_owner >= 2) OR ";
// $countsql .= "(group_id IN ($groupList) AND perm_group >= 2) OR ";
// $countsql .= "(perm_members >= 2) OR ";
//}
//$countsql .= "(perm_anon >= 2))";
//
//$data = DB_query($countsql);
//$D = DB_fetchArray($data);
//$num_pages = ceil($D['count'] / $perpage);
//
// Print Google-like paging navigation
//$base_url = $_CONF['site_url'] . '/pageindex.php';
//$display .= COM_printPageNavigation($base_url,$page, $num_pages);
//$display .= '</p>';

// +---------------------------------------------------------------------------+
// | voteindex.php |
// | This is a poll index page made especially for googlebots. |
// +---------------------------------------------------------------------------|
// | Copyright (C) 2002 by the following authors: |
// | Tom Willett - twillett@users.sourceforge.net |
// | Lee Whitworth - lwhitworth@users.sourceforge.net |
// +---------------------------------------------------------------------------|
// | 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. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA|
// | |
// +---------------------------------------------------------------------------|

$display .= '<h2>Опросы</h2>';

$sql = "SELECT *,unix_timestamp(date) AS day FROM {$_TABLES['pollquestions']} WHERE (date <= NOW())";
$sql .= " AND (";
if (!empty ($_USER['uid'])) {
$groupList = '';
foreach ($_GROUPS as $grp) {
$groupList .= $grp . ',';
}
$groupList = substr ($groupList, 0, -1);
$sql .= "(owner_id = {$_USER['uid']} AND perm_owner >= 2) OR ";
$sql .= "(group_id IN ($groupList) AND perm_group >= 2) OR ";
$sql .= "(perm_members >= 2) OR ";
}
$sql .= "(perm_anon >= 2))";

if (empty($page)) {
// If no page sent then assume the first.
$page = 1;
}

$offset = ($page -1) * $perpage;

$order = " ORDER BY date DESC LIMIT $offset, $perpage";

$recs = DB_query($sql . $order);
$nrows = DB_numRows($recs);

$display .= '<table width="100%"><tr><td><b>Вопрос</b></td><td><b>Высказалось</b></td></tr>';

for ($x = 0; $x < $nrows; $x++) {
$A = DB_fetchArray($recs);
$display .= '<tr><td>';
$display .= '<a href="' . $_CONF['site_url'] . '/pollbooth.php?qid=' . $A['qid'] . '">'
. $A['question'] . '</a>';
$display .='</td>' . '<td>' . $A['voters'] . '</td></tr>';
}

$display .= '</table><p>';

$countsql = "SELECT count(*) as count FROM {$_TABLES['pollquestions']} WHERE (date <= NOW())";
$countsql .= " AND (";
if (!empty ($_USER['uid'])) {
// Note: $groupList re-used from above
$countsql .= "(owner_id = {$_USER['uid']} AND perm_owner >= 2) OR ";
$countsql .= "(group_id IN ($groupList) AND perm_group >= 2) OR ";
$countsql .= "(perm_members >= 2) OR ";
}
$countsql .= "(perm_anon >= 2))";

$data = DB_query($countsql);
$D = DB_fetchArray($data);
$num_pages = ceil($D['count'] / $perpage);

// Print Google-like paging navigation
$base_url = $_CONF['site_url'] . '/voteindex.php';
$display .= COM_printPageNavigation($base_url,$page, $num_pages);

// Media Gallery

if ( function_exists('MG_initAlbums') ) {
    $display .= '<h2>Media Gallery</h2>';
    $display .= '<table width="100%"><tr><td width="60%"><b>Album</b></td><td><b>Media Count</b></td></tr>';
    $display .= MGshowTree( 0,0 );
    $display .= '</table>';
}

$display .= '</p></div>';

$display .= COM_siteFooter();
echo $display;
?>
 


If for some reason the cut/paste doesn't work well, you can download it from here.

Let me know if this is what you were looking for...

Thanks!
Mark
 Quote

Archy

Anonymous
Thank you very much, but only albums list showed... Frown

Can tou add code for list of ANY items from all albums?
PLEASE!!!
 Quote

Status: offline

ArchyAA

Forum User
Junior
Registered: 12/19/07
Posts: 28
Location:Kiev, Ukraine
This file work only with 1.4.*, not 1.5.*

Can anybody fix it for 1.5 ?
 Quote

Status: offline

ArchyAA

Forum User
Junior
Registered: 12/19/07
Posts: 28
Location:Kiev, Ukraine
Help pls - in 1.5 we have error like this:
Text Formatted Code
Wed Apr 29 12:41:06 2009 - 1054: Unknown column 'date' in 'field list'. SQL in question: SELECT *,unix_timestamp(date) AS day FROM fa_pollquestions WHERE (date <= NOW()) AND ((perm_anon >= 2)) ORDER BY date DESC LIMIT 0, 1075
 
 Quote

Status: offline

ArchyAA

Forum User
Junior
Registered: 12/19/07
Posts: 28
Location:Kiev, Ukraine
Trouble in VOTE (last) block...
And in last version MediaGallery we don't have the MGTree () function Frown
 Quote

All times are EST. The time is now 07:25 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content