<?php function phptemplate_preprocess_page(&$vars) { if(drupal_get_path_alias($_GET['q']) == 'cart/checkout/complete') { $vars['closure'] .= 'conversion script'; } } ?>
<?php $links = menu_primary_links(); foreach($links as $link): $x++; echo('<a href="' . url($link['href']) . '">' . $link['title'] . '</a> ' . ((count($links) == $x) ? "" : "|") ); endforeach; ?>
or
<?php $links = menu_navigation_links("primary-links"); foreach($links as $link): $x++; echo('<li><a href="' . url($link['href']) . '">' . $link['title'] . '</a></li> '); endforeach; ?>
Add this to template.php
<?php function phptemplate_preprocess_page(&$vars) { $args = arg(); if($args[0] == 'blog') { $vars['head_title'] = preg_replace("^Blogs^", "User's Blog", $vars['head_title']); $vars['title'] = "User's Blog"; } } ?>
<?php $node_type = 'page'; //fetch the nodes we want to delete $result = db_query("SELECT nid FROM {node} WHERE type='%s'",$node_type); while ($row = db_fetch_object($result)){ node_delete($row->nid); $deleted_count+=1; } //simple debug message so we can see what had been deleted. drupal_set_message("$deleted_count nodes have been deleted"); ?>
This rsyncs from a ssh server to your local machine, excluding svn files, and it has delete flag so its a mirror copy.
rsync -av --delete --progress --exclude '.svn/' username@domain.com:/some/directory ~/Desktop/backup/
# Block access to SVN files to the outside world <IfModule mod_rewrite.c> RewriteRule ^(.*/)?\.svn/ - [F,L] ErrorDocument 403 "Access Forbidden" </IfModule>
<?php function phptemplate_preprocess_page(&$vars) { if(drupal_get_path_alias($_GET['q']) == 'cart/checkout/complete') { // Getting order id preg_match("^Your order number is (\d*).^", $vars['content'], $matches); $order_id = $matches[1]; $order = uc_order_load($order_id); $vars['closure'] .= '<img src="https://shareasale.com/sale.cfm?amount=' . $order->order_total . '&tracking=' . $order->order_id . '&transtype=sale&merchantID=XXXXXX" width="1" height="1">'; } } ?>
function _login(&$form_state, &$edit) { $email = $form_state['account']['name']['#post']['mail']; $user = user_load(array('mail' => $email)); user_external_login($user); } function custom_form_alter(&$form, $form_state, $form_id) { if($form_id == "user_register"): $form['#submit'][] = '_login'; endif; return $form; }
function custom_user($op, &$edit, &$account, $category=NULL) { switch($op) { case 'validate': if(is_array($account)) // checking to make sure we're only doing this on register. { $edit['profile_name'] = $edit['name']; // setting profile name as username (name) $edit['name'] = $edit['mail']; // setting username (name) as mail address } break; } }