This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Simplenews Category Permissions

Hello,

I have installed the module Simplenews (version 4.6.0) on my site.
In the menu my account > edit > my newletters everyone can subscribe to ALL the newsletters, even if they don't have the access in Category Permissions.

Do you have an idea to correct the problem ?

Fatal error: Allowed memory size... I'm pretty sure it's my coding, not actually memory.

Okay, so I'm getting this:

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 276478 bytes) in /var/www/themes/engines/phptemplate/phptemplate.engine on line 336

The thing is, I had this once before on the same page I'm working on. The first time it was something with my coding...I just can't remember what though. Anyways, I got it fixed then, but I can't seem to find the problem now. I'm new to coding so it is very likely I messed up somewhere. If anyone could take a look and find what's doing it...or what may be doing it, would be greatly appreciated.



<?php

global $user;

$db = mysql_connect("localhost", "collin","MYPASSWORD");

mysql_select_db("MYDATABASE",$db);

//add books to database that are checked
$query="SELECT a.book, a.rarity, a.price, a.sid FROM collector_books a LEFT JOIN collector_books_read b ON a.sid = b.sid and b.uid = $user->uid WHERE b.sid IS NULL";

$result=mysql_query($query);
$num=mysql_numrows($result);

$i=0;
while ($i < $num) {
$sid=mysql_result($result,$i,"sid");

if($_REQUEST[$sid] == "on")
mysql_query("INSERT INTO collector_books_read VALUES ($sid, $user->uid)");

$i++;
}

//display all non-read books for user to select which ones he has read

if($_REQUEST['Submit'] != true){
if($_REQUEST['order_by']==""){
$order_by="book";
$_SESSION['old_page']=$order_by;
}elseif($_REQUEST['order_by']=="book" && $_SESSION['old_page']=="book"){
$order_by="book desc";
$_SESSION['old_page']="book desc";
}elseif($_REQUEST['order_by']=="book"){
$order_by="book";
$_SESSION['old_page']=$order_by;
}elseif($_REQUEST['order_by']=="rarity" && $_SESSION['old_page']=="rarity"){
$order_by="rarity desc";
$_SESSION['old_page']="rarity desc";
}elseif($_REQUEST['order_by'] == "rarity"){
$order_by="rarity";
$_SESSION['old_page']=$order_by;
}elseif($_REQUEST['order_by']=="price" && $_SESSION['old_page']=="price"){
$order_by="price desc";
$_SESSION['old_page']="price desc";
}elseif($_REQUEST['order_by'] == "price"){
$order_by="price";
$_SESSION['old_page']=$order_by;
}
}else
$order_by = $_SESSION['old_page'];

$query="SELECT a.book, a.rarity, a.price, a.sid FROM collector_books a LEFT JOIN collector_books_read b ON a.sid = b.sid and b.uid = $user->uid WHERE b.sid IS NULL ORDER BY $order_by";

$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
echo "Book Collector Checklist - Not Read

Everything is a node?

Sorry if this has been answered before; I couldn't find the answer. I'm making a testing engine as a Drupal module. Administrators will create and edit questions, and collect these questions into tests that users can then take. I've read in one of the handbooks that everything should be a node type.

How to set the menu settings of a newly created page in mailhandler module?

I would like to modify the mailhandler module so that the Parent item can be set as part of the commands supported by mailhandler. This is so that when a user submits a new post via email, they can have it automatically show up as a link under a particular menu in the site. I've read through the menu module and the mailhandler module but could use some suggestions or examples on how to do this. Thanks!

Hooks not all being called

I'm tearing my hair out over this one. For some reason Drupal is not triggering all the hooks in my custom module.

I'm creating a "review" content type. I have hooks for review_form, review_load, review_insert, review_validate, review_load and others. Only review_form, review_prepare and review_view appear to be recognized by Drupal, and even review_form only partially works because it's not calling review_load before the review_form, so the $node param is only populated with the basic node values, not the additional values I need to add via review_load().

Alexa Module

Does any drupal developer want to help me make a module that imports alexa data into some alexa charts. I really would like to build something that can display multiple charts, (5) from alexa, with a neat little ajax application. (see alexaholic dot com for an example). Can this be done?
I have made a very small module so far, but it does not have the features that i would eventually like.

test site: http://www.johnchalekson.com/alexa

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions