1
rennevat
Re: xcgallery hack to limit each user to one photo
  • 2008/12/18 21:48

  • rennevat

  • Just popping in

  • Posts: 6

  • Since: 2006/4/30


Thank you!! Your code helped put me on the right track and now it's working perfectly from within init.inc.php at line 172. I've modified it further to only search certain albums and assigned "finished" to enable certain messages.

if ($ugroup['can_upload_pictures'] == 1) {


$onepic = "SELECT COUNT(*) FROM ".$xoopsDB->prefix('xcgal_pictures')." WHERE (aid = 1 OR aid = 2 OR aid = 3) AND owner_id = '".$xoopsUser->getVar('uid')."'";
$resultlimit = $xoopsDB->query($onepic);
list($count) = $xoopsDB->fetchRow($resultlimit);
if ($count != 0) {
$USER_DATA['can_upload_pictures'] = 0;
$USER_DATA['finished'] = 1;
}
if ($count == 0) {
$USER_DATA['can_upload_pictures'] = $ugroup['can_upload_pictures'];
$USER_DATA['finished'] = 0;
}
}



2
rennevat
Re: xcgallery hack to limit each user to one photo
  • 2008/12/17 21:48

  • rennevat

  • Just popping in

  • Posts: 6

  • Since: 2006/4/30


I'm would like to limit users to uploading one photo and am still unable to resolve this. In include/init.inc.php around line 172, I am trying unsuccessfully with the following code:

if ($ugroup['can_upload_pictures'] == 1) {

$query = "SELECT pid FROM ".$xoopsDB->prefix("xcgal_pictures")." WHERE owner_id=".USER_ID." ";
$user_count = mysql_num_rows($query);

if ($user_count >= 1) {
$USER_DATA['can_upload_pictures'] = 0;
}


if ($user_count < 1) {
$USER_DATA['can_upload_pictures'] = $ugroup['can_upload_pictures'];
}
}



3
rennevat
xcgallery hack to limit each user to one photo
  • 2008/12/1 17:52

  • rennevat

  • Just popping in

  • Posts: 6

  • Since: 2006/4/30


Would it be possible to restrict each user with a group to submitting only one photo to a public album?



4
rennevat
Re: xoops banner system into a block?
  • 2008/11/26 17:06

  • rennevat

  • Just popping in

  • Posts: 6

  • Since: 2006/4/30


I believe the ability to specify specific banner ads (by ID) is located in the xoops_getbanner function. It currently pulls a random banner ID ($bannum). Modifying it to pull a random ID if a specific banner ID is not is not defined may be the way to go. Then you could create custom blocks to display an ad by ID in specific modules using ie. xoops_getbanner(22), etc. I am also trying to implement this and an testing out the following code within includes/functions.

/*
* Function to get banner html tags for use in templates
*/
function xoops_getbanner($bannernum)
{
global $xoopsConfig;
$db =& Database::getInstance();
$bresult = $db->query("SELECT COUNT(*) FROM ".$db->prefix("banner"));
list ($numrows) = $db->fetchRow($bresult);
$bannernum = intval($bannernum);

if ( $bannernum = '') {
if ( $numrows > 1 ) {
$numrows = $numrows-1;
mt_srand((double)microtime()*1000000);
$bannum = mt_rand(0, $numrows);

} else {
$bannum = 0;
}
} else {
$bannum = $bannernum;
}



5
rennevat
Re: Custom contact form for members/users that hides recipient email?
  • 2006/5/5 19:41

  • rennevat

  • Just popping in

  • Posts: 6

  • Since: 2006/4/30


Unfortunately, Liaise and Formulaire both require group settings for email selections. No individual user email option.

I copied the Contacts module and renamed it Contact Members and installed it via admin.

I've added the following to contact.php on line 42:
$contact_form->addElement(new XoopsFormHidden("$email_user", $HTTP_POST_VARS['email'];

and included the following in index.php:

$email_user = $HTTP_POST_VARS['email'];
$xoopsMailer->setToEmails($email_user);

But whatever I attempt, I get either one of the following messages:

XOOPS root path not defined
Parse error: parse error, unexpected ';' in /home/wildlife/public_html/modules/contactmbr/contact.php on line 42

Any help would be greatly appreciated.



6
rennevat
Custom contact form for members/users that hides recipient email?
  • 2006/5/5 15:41

  • rennevat

  • Just popping in

  • Posts: 6

  • Since: 2006/4/30


I would like to have a very simple contact form using xoopsmembers which allows the public and other members to email individual members without revealing the member's email address.

I've attempted to duplicate the contact module but am experiencing numerous errors. I've done searches but am only finding other modules with extensive features that I don't need.

Is there a way to do this by modifying the recipient info within index.php and contactform.php within the contact module so it is replaced with the specific member's email?

Thanks in advance.




TopTop



Login

Who's Online

142 user(s) are online (102 user(s) are browsing Support Forums)


Members: 0


Guests: 142


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits