/[drupal]/contributions/modules/user_tags/user_tags.module
ViewVC logotype

Diff of /contributions/modules/user_tags/user_tags.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.14.2.8, Tue May 6 19:12:40 2008 UTC revision 1.14.2.9, Tue May 6 19:35:13 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: user_tags.module,v 1.14.2.7 2007/10/09 09:03:31 flk Exp $  // $Id: user_tags.module,v 1.14.2.8 2008/05/06 19:12:40 deekayen Exp $
3    
4  /**  /**
5   * Implementation of hook_help().   * Implementation of hook_help().
# Line 183  function user_tags_page_list() { Line 183  function user_tags_page_list() {
183    }    }
184    
185    foreach ($vocab as $vid => $tid) {    foreach ($vocab as $vid => $tid) {
186      foreach ($tid as $term_tid=>$term_name) {      foreach ($tid as $term_tid => $term_name) {
187        $rows[] = array(l($term_name, "tag/user/$term_tid"));        $rows[] = array(l($term_name, "tag/user/$term_tid"));
188      }      }
189    }    }
# Line 254  function user_tags_get_terms_by_vocabula Line 254  function user_tags_get_terms_by_vocabula
254   * @param  array $account  : user details   * @param  array $account  : user details
255   * @return array : taxonomy form   * @return array : taxonomy form
256   */   */
257  function user_tags_form_tags($category, $account){  function user_tags_form_tags($category, $account) {
258    if ($category != 'tags') {    if ($category != 'tags') {
259      return;      return;
260    }    }
# Line 331  function user_tags_form_tags($category, Line 331  function user_tags_form_tags($category,
331   *   *
332   * @param object $account : User Object for modifying (passed ByRef)   * @param object $account : User Object for modifying (passed ByRef)
333   */   */
334  function user_tags_load_tags(&$account){  function user_tags_load_tags(&$account) {
335    $result = db_query('SELECT t.* FROM {term_data} t INNER JOIN {term_user} tu WHERE tu.tid = t.tid AND tu.uid = %d ORDER BY weight, name', $account->uid);    $result = db_query('SELECT t.* FROM {term_data} t INNER JOIN {term_user} tu WHERE tu.tid = t.tid AND tu.uid = %d ORDER BY weight, name', $account->uid);
336    $account->taxonomy = array();    $account->taxonomy = array();
337    while ($term = db_fetch_object($result)) {    while ($term = db_fetch_object($result)) {
# Line 345  function user_tags_load_tags(&$account){ Line 345  function user_tags_load_tags(&$account){
345   *   *
346   * @param object $account : User Object   * @param object $account : User Object
347   */   */
348  function user_tags_delete_tags($account){  function user_tags_delete_tags($account) {
349    db_query('DELETE FROM {term_user} WHERE uid = %d', $account->uid);    db_query('DELETE FROM {term_user} WHERE uid = %d', $account->uid);
350  }  }
351    
# Line 357  function user_tags_delete_tags($account) Line 357  function user_tags_delete_tags($account)
357   * @param array $edit : the values returned from the submitted form   * @param array $edit : the values returned from the submitted form
358   * @param object $account : The User Object   * @param object $account : The User Object
359   */   */
360  function user_tags_submit_tags($category, $edit, $account){  function user_tags_submit_tags($category, $edit, $account) {
361    if ($category != 'tags') {    if ($category != 'tags') {
362      return;      return;
363    }    }
# Line 366  function user_tags_submit_tags($category Line 366  function user_tags_submit_tags($category
366    
367    if (is_array($edit['taxonomy'])) {    if (is_array($edit['taxonomy'])) {
368      if (isset($edit['taxonomy']['freetags'])) {      if (isset($edit['taxonomy']['freetags'])) {
369        foreach ($edit['taxonomy']['freetags'] as $key => $value){        foreach ($edit['taxonomy']['freetags'] as $key => $value) {
370          $vid = $key;          $vid = $key;
371          $regexp = '%(?:^|,\ *)("(?>[^"]*)(?>""[^"]* )*"|(?: [^",]*))%x';          $regexp = '%(?:^|,\ *)("(?>[^"]*)(?>""[^"]* )*"|(?: [^",]*))%x';
372          preg_match_all($regexp, $value, $matches);          preg_match_all($regexp, $value, $matches);
# Line 416  function user_tags_submit_tags($category Line 416  function user_tags_submit_tags($category
416   * @param object $account : User account object (from user_load() function)   * @param object $account : User account object (from user_load() function)
417   * @return array : nested array   * @return array : nested array
418   */   */
419  function user_tags_view_tags($account){  function user_tags_view_tags($account) {
420    $list = array();    $list = array();
421    foreach ($account->taxonomy as $tid => $term) {    foreach ($account->taxonomy as $tid => $term) {
422      $list[] = array('value' => l($term->name, "tag/user/$tid"));      $list[] = array('value' => l($term->name, "tag/user/$tid"));

Legend:
Removed from v.1.14.2.8  
changed lines
  Added in v.1.14.2.9

  ViewVC Help
Powered by ViewVC 1.1.2