--- /dev/null
+<?php
+/***************************************************************************
+Copyright (C) 2004 - 2006 Scuttle project
+http://sourceforge.net/projects/scuttle/
+http://scuttle.org/
+
+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
+***************************************************************************/
+
+/* Return a json file with list of tags according to current user and sort by popularity*/
+
+require_once('../header.inc.php');
+
+/* Service creation: only useful services are created */
+$b2tservice =& ServiceFactory::getServiceInstance('Bookmark2TagService');
+$bookmarkservice =& ServiceFactory::getServiceInstance('TagService');
+
+?>
+
+{identifier:"tag",
+items: [
+<?php
+ $listTags = $b2tservice->getAdminTags(1000, $userservice->getCurrentUserId());
+ foreach($listTags as $t) {
+ echo "{tag: \"".$t['tag']."\"},";
+ }
+?>
+]}
+
+
+
+
$adminemail = 'admin@example.org'; # Contact address for the site administrator. Used as the FROM address in password retrieval e-mails.
$admin_users = array(''); # admin users = array('adminnickname', 'user1nick', 'user2nick');
$adminsCanModifyBookmarksFromOtherUsers = true; # 'true' if admin users can edit or delete bookmarks belonging to other users. Else 'false'.
+$adminsAreAdvisedTagsFromOtherAdmins = false; # 'true' if tags from other admins are proposed to each admin (in add/edit a bookmark page). Else 'false'.
$reservedusers = array('all', 'watchlist'); # array of usernames that cannot be registered
# Antispam
$antispamQuestion = 'name of this application (no Caps)'; # antispamQuestion: A question to avoid spam
$this->db->sql_freeresult($dbresult);
return $output;
}
+
+ function &getAdminTags($limit = 30, $logged_on_user = NULL, $days = NULL) {
+ // look for admin ids
+ $userservice = & ServiceFactory :: getServiceInstance('UserService');
+ $admins = array();
+ foreach($GLOBALS['admin_users'] as $adminName) {
+ $admins[] = $userservice->getIdFromUser($adminName);
+ }
+
+ // ask for their tags
+ return $this->getPopularTags($admins, $limit, $logged_on_user, $days);
+ }
+ // $users can be {NULL, an id, an array of id}
function &getPopularTags($user = NULL, $limit = 30, $logged_on_user = NULL, $days = NULL) {
// Only count the tags that are visible to the current user.
if (($user != $logged_on_user) || is_null($user) || ($user === false))
$query = 'SELECT T.tag, COUNT(T.bId) AS bCount FROM '. $this->getTableName() .' AS T, '. $GLOBALS['tableprefix'] .'bookmarks AS B WHERE ';
if (is_null($user) || ($user === false)) {
$query .= 'B.bId = T.bId AND B.bStatus = 0';
+ } elseif(is_array($user)) {
+ $query .= ' (1 = 0'; //tricks
+ foreach($user as $u) {
+ $query .= ' OR B.uId = '. $this->db->sql_escape($u) .' AND B.bId = T.bId';
+ }
+ $query .= ' )';
} else {
$query .= 'B.uId = '. $this->db->sql_escape($user) .' AND B.bId = T.bId'. $privacy;
}
<tr>
<th align="left"><?php echo T_('Tags'); ?></th>
<td class="scuttletheme">
- <span dojoType="dojo.data.ItemFileReadStore" jsId="memberTagStore" url="<?php echo ROOT?>ajax/gettags.php"></span>
+ <span dojoType="dojo.data.ItemFileReadStore" jsId="memberTagStore" url="<?php echo ROOT?>ajax/<?php echo ($GLOBALS['adminsAreAdvisedTagsFromOtherAdmins'] && $currentUser->isAdmin())?'getadmintags':'gettags'?>.php"></span>
<input type="text" dojoType="js.MultiComboBox" id="tags" name="tags" size="75" value="<?php echo filter(implode(', ', $row['tags']), 'xml'); ?>" store="memberTagStore" delimiter="," searchAttr="tag" hasDownArrow="false" queryExpr="*${0}*" autoComplete="false" highlightMatch="all"/></td>
<td>← <?php echo T_('Comma-separated'); ?></td>
</tr>
</form>
</li>
<?php endif; ?>
-
- <?php if(count($watching) == 0):?>
- <li><?php echo T_("Nobody");?></li>
- <?php endif; ?>
<?php foreach($watching as $watchuser): ?>
<li><a href="<?php echo createURL('bookmarks', $watchuser); ?>"><?php echo $watchuser; ?></a>
#NOTHING TO CHANGE IN DB
- Upgrade your current configuration file (config.inc.php) with respect to config.inc.php.example
$adminsCanModifyBookmarksFromOtherUsers = true; # 'true' if admin users can edit or delete bookmarks belonging to other users. Else 'false'.
+$adminsAreAdvisedTagsFromOtherAdmins = false; # 'true' if tags from other admins are proposed to each admin (in add/edit a bookmark page). Else 'false'.
=== From version 0.91 to 0.92 ===