A blog-inspired module

I'm new to Drupal and developing a new module for listing out a user's podcast(s). It is basically for a community directory of podcasts, but I used the blog.module as a template since it had a lot of the functionality I was looking for.

I've got the individual node pages working and the last-10 block too, but the other pages are busted or not found.

To be specific, the list of recent nodes, specific user-owed nodes and the feed don't work. Any ideas?


/**
* Implementation of hook_view().
*/
function podlisting_view(&$node, $teaser = FALSE, $page = FALSE) {
$node = node_prepare($node, $teaser);
$profile = theme('podlisting_profile', $node);
$node->body .= $profile;
$node->teaser .= $profile;
}

/**
* Implementation of hook_user().
*/
function podlisting_user($type, &$edit, &$user) {
if ($type == 'view' && user_access('edit own podlisting', $user)) {
$form['podlisting'] = array(
'#type' => 'item', '#title' => t('podlisting'),
'#value' => l(t('associated podlistings'), "podlisting/$user->uid", array('title' => t("Check out %username's podlistings.", array('%username' => $user->name))))
);
return array(t('Vlogs') => $form);
}
}

/**
* Menu callback; displays a Drupal page containing recent podlisting entries.
*/
function podlisting_page($a = NULL, $b = NULL) {

if (is_numeric($a)) { // $a is a user ID

access control question - 'edit all pages'

I've lost my way somewhere. I wanted to give a certain role permission to update all pages within a certain category, no matter who created them.

I have taxonomy_access for the category part... but it looked like I needed an 'edit all pages' permission first.

So I decided to try my very first patch...

Scalability of Flexinode on large sites

We all know that flexinode is a nice module, providing a lot of site admin flexibility with no need for programming.

Two objections to flexinode are :

1. It will eventually be replaced by CCK (content module?) in 4.8 or later (what is the current estimate on this anyways?)

2. Because it has to use multi-way joins, it can be resource expensive on a busy site. This is why sites like BuyBlue and ProjectOpus did not use flexinode.

HTTPPost, AJAX

I am trying to develop a module using AJAX. I need to submit a form using post. I am using 'HTTPPost' method that is available in drupal.js. But I am not able to pass the FORM DATA to the php handler. How is this done ? and how is the data handled in php. Any help will be appreciated.

Regards

Karthik

Horizontalism ... again ...

I've posted on this before, and I'm going to try various solutions to it on my (developing) site when I get a chance, but I just thought I'd put in a request. As people far smarter than I work on new themes, I hope that a few of them give some consideration to assembling themes, particularly in phptemplate, that use horizontal block regions.

--|PW|--

Using phpTemplate to detect section

Hi,

I've been working on a new site (4.7 using phpTemplate) which has a fairly standard layout with a Blog/Articles section and a forum. But I've been wanting the forum to have a different layout, the FlatForum module got me halfway there, but I need the forum page template to be different too.

So I made a little script in the page.tpl.php file to detect if the user was on the a forum page and deliver a different template if they were. Here is the code I'm using, it basically uses the url to detect if it is a forum page or if the node type is 'forum':


<?php

//////////////////////
// DETECT FORUM PAGE //
//////////////////////

$ukf_url_expode = explode('/', url($_GET['q'], NULL, NULL, NULL)); 
$ukf_url_expode_rev = array_reverse($ukf_url_expode); 


$ukf_url_nid = $ukf_url_expode_rev[0];

$sql = "SELECT vocabulary_node_types.vid
		FROM node, vocabulary_node_types
		WHERE $ukf_url_nid = node.nid 
		AND node.type = vocabulary_node_types.type";

$result = mysql_query($sql);
$row = mysql_fetch_row($result);

if ($ukf_url_expode[0] == 'forum' or $row[0] == '1' ):


//////////////////////
// START FORUM PAGE //
//////////////////////
?> 

**Forum Template Code**

<?php 
///////////////////////
// START NORMAL PAGE //
///////////////////////

**Normal Template code**

<?php
 endif;
?>
else: 
?> 

So far it is working fine, but I'm a designer really, not a programmer (I just learn what I need to as I go along) so I'd like the opinion of someone more versed in PHP as to whether it is a good idea to use this system on a production site or if it is a horrible hack that'll cause me problems later.

Pages

Subscribe with RSS Subscribe to RSS - Drupal 4.7.x