weblog, content management & redaktion
RSS Feed für `Quellcode` Seite drucken

Codedarstellung auf der Seite

HTML:

  <div class="search">    
  <form action="?"
        method="get"
        name="sf2"
        onsubmit="return sendSearchForm(this);"  
        style="padding:0px">  
    <input name="q"  
           onKeyUp="getSuggestions(event, this)"  
           value="Suche"  
           onFocus="if(this.value=='Suche'){this.value=''}"  
           onBlur="showSuggestion('');if(this.value==''){this.value='Suche'}"  
           class="search_box c_border c_text c_textcolor c_content_background"/>  
  </form>  
</div>


CSS:

  #edit_external{    
  position:fixed!important;  
  top:-1px!important;  
  left:50px!important;  
  display: block!important;  
  border:none!important;  
  z-index:5010!important;  
}  
.mceExternalClose{  
  display:none!important;    
}  
.mceToolbar{  
  background-color: transparent!important;    
}  
.mceIcon{  
  cursor:url(/img/edit.cur),default!important;  
}

 

Javascript:

  function sendItemForm( form ){    
  resetLogout();  
  data = getAjaxFormData(form);  
  AXSendForm = new ajaxObject("?m=saveItem", removeItemForm );  
  AXSendForm.update(data,"post");  
  return false;  
}


PHP:

  function getFinalKeyWords(){    
  global $pagekeywords, $partkeywords;  
  if(!stristr($pagekeywords," ")===false){  
    $words = implode(", ", $partkeywords);  
    $words = str_replace( " ", $words, $pagekeywords );  
    $words = mb_ereg_replace( "[ ]*,[ ]*", ",", $words ); // trim  
    $aWords = explode(",",$words);  
    $aWords = array_unique( $aWords );  
    $words = implode(", ", $aWords);  
    $pagekeywords=$words;  
    return $words;  
  }else{  
    return $pagekeywords;
  }  
}

 

SQL:

  SELECT    
    t.id ,  
    t.title,  
    GROUP_CONCAT( DISTINCT t.pathid ORDER BY rownum DESC SEPARATOR ',')
AS cat_path_ids,  
    GROUP_CONCAT( DISTINCT urights.code SEPARATOR ',') AS usr_rights,  
    GROUP_CONCAT( DISTINCT grights.code SEPARATOR ',') AS usg_rights  
FROM  
  ( SELECT  
      @rownum := @rownum+1 AS rownum,      
      IF(@lastid <> mylist.id, @id := mylist.id, @id) AS pathid,  
      @lastid := mylist.id AS id,  
      mylist.title AS title,  
      @id := (SELECT p_id FROM cat  WHERE id = @id) AS parentID  
    FROM  
      (SELECT @id := 0, @lastid := 0, @rownum := 0) AS vars,  
      (SELECT id FROM cat) AS myloop,  
      (SELECT id, title FROM cat) AS mylist  
  ) AS t  
LEFT JOIN (SELECT rig.code, zru.cat_id
           FROM rig, zru
           WHERE zru.usr_id = {$UID} AND zru.rig_id  = rig.id
          ) AS urights  
ON urights.cat_id = t.pathid  
LEFT JOIN (SELECT rig.code, zug.cat_id FROM rig, zug, zrg
           WHERE zug.usr_id = {$UID} AND zug.usg_id  = zrg.usg_id
                 AND zrg.rig_id = rig.id
          ) AS grights  
ON grights.cat_id = t.pathid  
WHERE t.pathid IS NOT NULL  
GROUP BY t.id