Skip to Content Skip to Menu

UserList Module

  • pantela
  • pantela
  • OFFLINE
  • Posts: 2
  • Thanks: 0
  • Karma: -1
13 years 11 months ago #146444 by pantela
UserList Module was created by pantela
I started writing a module UserList.
Several questions arise:
1. How to display a full list of
2. How to display the number of users who belong to this list

mod_cb_userlist/mod_cb_userlist.php
[code:1]<?php

defined('_JEXEC') or die('Restricted access');

require(JModuleHelper::getLayoutPath('mod_cb_userlist'));

function getUserList(){
$db =& JFactory::getDBO();

$query = "SELECT `title` "
." FROM `#__comprofiler_lists` "
." ORDER BY `listid` ASC";

$db->setQuery($query);

$UserList = $db->loadResult();

return $UserList;
}


function getUserCount(){
$db =& JFactory::getDBO();

$query = "SELECT COUNT(*) "
." FROM `#__comprofiler` "
." WHERE `cb_myvalue` = ".$UserList."";

$db->setQuery($query);

$UserList = $db->loadResult();

return $UserList;
}[/code:1]


mod_cb_userlist/tmpl/default.php
[code:1]<?php echo getUserList(); ?> (<?php echo getUserCount(); ?>«»)[/code:1]

Now:
1. Only one list title is show
2. How i can to count user in list:huh:

Post edited by: pantela, at: 2010/11/16 23:25

Post edited by: pantela, at: 2010/11/16 23:43

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum