Any idea is there is a hack that will show a link in newbb to the user xcgallery albulms?
Best Regards,
jose Febus
[img]www.tumaternidad.com/photo.jpg[/img]
echo "<form action="admin.php" method="post">n";
echo "<input type="hidden" name="id" value="".$user->getVar("uid")."">";
echo "<input type="hidden" name="type" value="user">n";
echo "<input type="hidden" name="fct" value="users">n";
echo "<input type="hidden" name="op" value="synchronize">n";
echo "<input type="submit" value=""._AM_SYNCHRONIZE."">n";
echo "</form>n";
echo "<form action="admin.php" method="post">n";
echo "<input type="hidden" name="id" value="".$user->getVar("uid")."">";
echo "<input type="hidden" name="type" value="all users">n";
echo "<input type="hidden" name="fct" value="users">n";
echo "<input type="hidden" name="op" value="synchronize">n";
echo "<input type="submit" value="Synchronize All Users">n";
echo "</form>n";
function mysynchronize($id)
{
global $xoopsDB;
// Array of tables from which to count 'posts'
$tables = array();
// Count comments (approved only: com_status == XOOPS_COMMENT_ACTIVE)
include_once XOOPS_ROOT_PATH . '/include/comment_constants.php';
$tables[] = array ('table_name' => 'xoopscomments',
'uid_column' => 'com_uid', 'criteria' => new Criteria('com_status', XOOPS_COMMENT_ACTIVE));
// Count forum posts
$tables[] = array ('table_name' => 'bb_posts',
'uid_column' => 'uid');
$total_posts = 0;
foreach ($tables as $table) {
$criteria = new CriteriaCompo();
$criteria->add (new Criteria($table['uid_column'], $id));
if (!empty($table['criteria'])) {
$criteria->add ($table['criteria']);
}
$sql = "SELECT COUNT(*) AS total
FROM ".$xoopsDB->prefix($table['table_name']) . ' ' . $criteria->renderWhere();
if ( $result = $xoopsDB->query($sql) ) {
if ($row = $xoopsDB->fetchArray($result)) {
$total_posts = $total_posts + $row['total'];
}
}
}
$sql = "UPDATE ".$xoopsDB->prefix("users")." SET posts = $total_posts WHERE uid = $id";
if ( !$result = $xoopsDB->query($sql) ) {
exit(sprintf(_AM_CNUUSER %s ,$id));
}
}
function synchronize($id, $type)
{
global $xoopsDB;
switch($type) {
case 'user':
mysynchronize($id);
break;
case 'all users':
$sql = "SELECT uid FROM ".$xoopsDB->prefix("users")."";
if ( !$result = $xoopsDB->query($sql) ) {
exit(_AM_CNGUSERID);
}
while ($row = $xoopsDB->fetchArray($result)) {
$id = $row['uid'];
mysynchronize($id);
}
break;
default:
break;
}
redirect_header("admin.php?fct=users&op=modifyUser&uid=".$id,1,_AM_DBUPDATED);
exit();
}
echo "<form action="admin.php" method="post">n";
echo "<input type="hidden" name="id" value="".$user->getVar("uid")."">";
echo "<input type="hidden" name="type" value="all users">n";
echo "<input type="hidden" name="fct" value="users">n";
echo "<input type="hidden" name="op" value="synchronize">n";
echo "<input type="submit" value=""._AM_SYNCHRONIZE."">n";
echo "</form>n";
case 'all users':
$sql = "SELECT uid FROM ".$xoopsDB->prefix("users")."";
if ( !$result = $xoopsDB->query($sql) ) {
exit(_AM_CNGUSERID);
}
while ($row = $xoopsDB->fetchArray($result)) {
$id = $row['uid'];
synchronize($id, "user");
}
break;