
Create Your Badge
<?php
$current_type='**Name a content type here**';
$contact_name='';
if (arg(1)=='add') {
// if adding we need to go get the parent title from the database
// url typically has parent nid in URL like this:
// /node/add/!!blanked!!/parent/39620
if (is_numeric(arg(4))) {
$tmp_node=node_load(arg(4));
$contact_name=$tmp_node->title;
}
}
if ($contact_name=='') {
// if editing we have parent title via token
$contact_name='[parent-title]';
}
if ($contact_name!='') {
select * FROM
content_type_venue
/* association table*/
LEFT JOIN content_field_event_ref_venue
ON content_field_event_ref_venue.field_event_ref_venue_nid = content_type_venue.nid
/* join the event to the association tab;e*/
LEFT JOIN node n_event
ON n_event.nid = content_field_event_ref_venue.nid
/* load event table */
LEFT JOIN event event
ON event.nid = n_event.nid
WHERE (
content_type_venue.field_venue_status_value='1'
AND
content_type_venue.field_venue_livewire_yesno_value='1'
AND
event.nid is not null
)
* Could pull path info out of $venue_info instead
<?php
// C4 Edit - Adding Venue information to the event table listing
$venue_id = $node->field_event_ref_venue['0']['nid'];
if($venue_id!=''){
$venue_info = node_load($venue_id);
$venue_title=$venue_info->title;
$output .= '<div class="content description">'. l($venue_title, 'node/' . $venue_id) .'</div></div>'."\n";
};
// end edit
?>After receiving errors like: * user warning: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation 'like' query: SELECT t.tid, t.name FROM term_data t WHERE t.vid = 14 AND LOWER(t.name) LIKE LOWER('%dfgdfg%') LIMIT 0, 10 in /---path---/html/includes/database.mysql.inc on line 172. * The installed version of at least one of your modules or themes is no longer supported. Upgrading or disabling is strongly recommended!
Copied from: http://drupal.org/node/46391 Latest update of this script inversed - March 31, 2008 - 17:44 I was using this and having some problems. Short amounts of text were resulting in an extra greater than sign and strong tags were breaking the results. This is Fat Matt's updated code which works great for me now.
Phpfox mods of interest:
My schools $50:
http://www.konsort.org/schools.php
Section adder $50:
http://www.konsort.org/sectionadder.php
My events $15:
http://www.konsort.org/myevents.php
Map events $15:
http://www.konsort.org/geomaponevents.php
Decent arcade script ($60 -- need more research, does this really include game license? ):
http://www.konsort.org/arcade.php
Emoticon $15:
http://www.konsort.org/statusandmood.php
Possible free weather mod, may eed some love:
http://forums.phpfox.com/showthread.php?t=9133
horoscope (links out, semi crappy)