[geeklog-cvs] Geeklog-1.x/plugins/links functions.inc,1.93,1.94

Dirk Haun dhaun at qs1489.pair.com
Mon Dec 31 05:41:49 EST 2007


Update of /cvsroot/geeklog/Geeklog-1.x/plugins/links
In directory qs1489.pair.com:/tmp/cvs-serv33209/plugins/links

Modified Files:
	functions.inc 
Log Message:
Fixed Links plugin update and handling of categories (for backward compatibility)


Index: functions.inc
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/plugins/links/functions.inc,v
retrieving revision 1.93
retrieving revision 1.94
diff -C2 -d -r1.93 -r1.94
*** functions.inc	29 Dec 2007 19:04:35 -0000	1.93
--- functions.inc	31 Dec 2007 10:41:47 -0000	1.94
***************
*** 198,205 ****
              $cid = COM_applyFilter ($autotag['parm1']);
              $url = COM_buildUrl ($_CONF['site_url']
!                                  . '/links/index.php?cid=' . $cid);
              if (empty ($autotag['parm2'])) {
!                 $linktext = stripslashes (DB_getItem ($_TABLES['linkcategories'],
!                                           'category', "cid = '$cid'"));
              } else {
                  $linktext = $autotag['parm2'];
--- 198,205 ----
              $cid = COM_applyFilter ($autotag['parm1']);
              $url = COM_buildUrl ($_CONF['site_url']
!                     . '/links/index.php?category=' . urlencode($cid));
              if (empty ($autotag['parm2'])) {
!                 $linktext = stripslashes(DB_getItem($_TABLES['linkcategories'],
!                                          'category', "cid = '$cid'"));
              } else {
                  $linktext = $autotag['parm2'];
***************
*** 1039,1045 ****
      $linkform->set_var('lang_link', $LANG_LINKS_SUBMIT[2]);
      $linkform->set_var('lang_category', $LANG_LINKS_SUBMIT[3]);
!     $dummycategory = '';
!     $linkform->set_var('link_category_options',
!                        links_select_box (2,$dummycategory));
      $linkform->set_var('lang_description', $LANG12[15]);
      $linkform->set_var('lang_htmlnotallowed', $LANG12[35]);
--- 1039,1047 ----
      $linkform->set_var('lang_link', $LANG_LINKS_SUBMIT[2]);
      $linkform->set_var('lang_category', $LANG_LINKS_SUBMIT[3]);
!     $category = '';
!     if (isset($_REQUEST['cid'])) {
!         $category = $_REQUEST['cid'];
!     }
!     $linkform->set_var('link_category_options', links_select_box(2, $category));
      $linkform->set_var('lang_description', $LANG12[15]);
      $linkform->set_var('lang_htmlnotallowed', $LANG12[35]);
***************
*** 1211,1218 ****
                      $indent = 0;
                  }
!                 $cat = COM_createLink(
!                     $A['category'],
!                     "{$_CONF['site_url']}/links/index.php?cid={$A['cid']}"
!                 );
                  $retval = "<span style=\"padding-left:{$indent}px;\">$cat</span>";
                  break;
--- 1213,1219 ----
                      $indent = 0;
                  }
!                 $cat = COM_createLink($A['category'],
!                         "{$_CONF['site_url']}/links/index.php?category="
!                         . urlencode($A['cid']));
                  $retval = "<span style=\"padding-left:{$indent}px;\">$cat</span>";
                  break;
***************
*** 1240,1244 ****
                      $retval = COM_createLink(
                          $icon_arr['edit'],
!                         "{$_CONF['site_admin_url']}/plugins/links/category.php?mode=edit&cid={$A['cid']}"
                      );
                  }
--- 1241,1245 ----
                      $retval = COM_createLink(
                          $icon_arr['edit'],
!                         "{$_CONF['site_admin_url']}/plugins/links/category.php?mode=edit&cid=" . urlencode($A['cid'])
                      );
                  }
***************
*** 1252,1260 ****
                  break;
              case 'category':
!                 $indent = ($A['indent']-1) * 20;
!                 $cat = COM_createLink(
!                     $A['category'],
!                     "{$_CONF['site_url']}/links/index.php?cid={$A['cid']}"
!                 );
                  $retval = "<span style=\"padding-left:{$indent}px;\">$cat</span>";
                  break;
--- 1253,1260 ----
                  break;
              case 'category':
!                 $indent = ($A['indent'] - 1) * 20;
!                 $cat = COM_createLink($A['category'],
!                         "{$_CONF['site_url']}/links/index.php?category="
!                         . urlencode($A['cid']));
                  $retval = "<span style=\"padding-left:{$indent}px;\">$cat</span>";
                  break;
***************
*** 1263,1267 ****
                      $retval = COM_createLink(
                          $icon_arr['addchild'],
!                         "{$_CONF['site_admin_url']}/plugins/links/category.php?mode=edit&pid={$A['cid']}"
                      );
                  }
--- 1263,1267 ----
                      $retval = COM_createLink(
                          $icon_arr['addchild'],
!                         "{$_CONF['site_admin_url']}/plugins/links/category.php?mode=edit&pid=" . urlencode($A['cid'])
                      );
                  }
***************
*** 1401,1414 ****
  }
  
! // +-----------------------------------------------------------------------------------------------+
! // | Category HTML functions                                                                       |
! // | Functions for building select boxes and breadcrumb trails etc.                                |
! // +-----------------------------------------------------------------------------------------------+
  
  /*
  * Build selection list
  */
! function links_select_box ($access, $sel = '') {
      global $_CONF, $LANG_LINKS, $_LI_CONF;
      // set root value
      $menu = '<option value="' . $_LI_CONF['root'] . '">' . $LANG_LINKS['root'] . '</option>';
--- 1401,1416 ----
  }
  
! // +--------------------------------------------------------------------------+
! // | Category HTML functions                                                  |
! // | Functions for building select boxes and breadcrumb trails etc.           |
! // +--------------------------------------------------------------------------+
  
  /*
  * Build selection list
  */
! function links_select_box ($access, $sel = '')
! {
      global $_CONF, $LANG_LINKS, $_LI_CONF;
+ 
      // set root value
      $menu = '<option value="' . $_LI_CONF['root'] . '">' . $LANG_LINKS['root'] . '</option>';
***************
*** 1423,1427 ****
  * Build recursive tree
  */
! function links_select_box_recursive (&$menu, $cid, $sel, $indent, $access) {
      global $_CONF, $_TABLES;
      $sql = "SELECT cid,category
--- 1425,1430 ----
  * Build recursive tree
  */
! function links_select_box_recursive (&$menu, $cid, $sel, $indent, $access)
! {
      global $_CONF, $_TABLES;
      $sql = "SELECT cid,category
***************
*** 1432,1436 ****
      while ( list($cid,$category) = DB_fetchArray($query) ) {
          // set selected item
!         if ($cid==$sel) {
              // yes, selected
              $menu .= '<option value="'.$cid.'" selected="selected">'.$indent.$category.'</option>';
--- 1435,1439 ----
      while ( list($cid,$category) = DB_fetchArray($query) ) {
          // set selected item
!         if ($cid == $sel) {
              // yes, selected
              $menu .= '<option value="'.$cid.'" selected="selected">'.$indent.$category.'</option>';
***************
*** 1460,1463 ****
--- 1463,1468 ----
  
      $breadcrumb = '';
+     $separator  = ' : ';
+ 
      $c = $cid;
      $pid = '';
***************
*** 1468,1473 ****
              if ($cid != $c) {
                  $content = stripslashes($A['category']);
!                 $url = $_CONF['site_url'] . '/links/portal.php?what=category&item=' . $A['cid'];
!                 $breadcrumb = COM_createLink($content, $url) . ' : ' . $breadcrumb;
              } else {
                  $breadcrumb = $A['category'] . $breadcrumb;
--- 1473,1478 ----
              if ($cid != $c) {
                  $content = stripslashes($A['category']);
!                 $url = $_CONF['site_url'] . '/links/portal.php?what=category&item=' . urlencode($A['cid']);
!                 $breadcrumb = COM_createLink($content, $url) . $separator . $breadcrumb;
              } else {
                  $breadcrumb = $A['category'] . $breadcrumb;
***************
*** 1479,1483 ****
  
      $url = $_CONF['site_url'] . '/links/index.php';
!     $breadcrumb = COM_createLink($LANG_LINKS['root'], $url) . ' : ' . $breadcrumb;
  
      return $breadcrumb;
--- 1484,1492 ----
  
      $url = $_CONF['site_url'] . '/links/index.php';
!     if (empty($breadcrumb)) {
!         $breadcrumb = $LANG_LINKS['root'];
!     } else {
!         $breadcrumb = COM_createLink($LANG_LINKS['root'], $url) . $separator . $breadcrumb;
!     }
  
      return $breadcrumb;
***************
*** 1539,1543 ****
                  $A = DB_fetchArray($result);
                  $content = stripslashes($A['category']);
!                 $url = $_CONF['site_url'] . '/links/portal.php?what=category&item=' . $A['cid'];
                  $retval .= COM_createLink($content, $url) . '<br' . XHTML . '>';
              }
--- 1548,1552 ----
                  $A = DB_fetchArray($result);
                  $content = stripslashes($A['category']);
!                 $url = $_CONF['site_url'] . '/links/portal.php?what=category&item=' . urlencode($A['cid']);
                  $retval .= COM_createLink($content, $url) . '<br' . XHTML . '>';
              }




More information about the geeklog-cvs mailing list