No es soporte para el icy, asi que al final dejo otros datos de soporte.
quiero hacer q el cookbook/autolink.php redireccione a Vocabulario.Nombre, en vez de a GrupoActual.Nombre.
me explico:
esa extension sirve para palabras comunmente utilizadas, las detecta como neccesarias para añadir al wiki y las marca como link a Nombredelgrupoactual.Termino. Si existen las linka, Si no, las linka en rojo para q la edites tu.... pero como la mayoria de palabras aparecen en manuales.. es obvio q en Manuales.PalabraDeVocabulario no va existir... por eso quiero q no detecte la pagina actual.. q siempre linke a Vocabulario.Termino
- #set predefined values
- $AutoLinkList = array();
- $AutoLinkTime = 0;
- SDV($AutoLinkMinSize,2);
- # read the comparison table from a file and place it in an array
- function AutoLinkListRead($group) {
- global $AutoLinkList, $AutoLinkTime,$WorkDir,$AutoLinkMinSize;
- # read information from file and fill array
- $filename = "$WorkDir/.autolink-$group";
- if (file_exists($filename)) {
- $AutoLinkTime = filemtime($filename);
- }
- if ($fp=@gzopen($filename, "r")) {
- while (!gzeof($fp)) {
- $line = rtrim(gzgets($fp, 4096));
- $part = explode ("%0a", $line); # delimiter between data is string "%0a"
- if (strlen($part[1])>=$AutoLinkMinSize) {
- $AutoLinkList[$part[0]] = $part[1]; # add entry to array
- }
- }
- gzclose ($fp);
- }
- }
- # sorting helper function to sort regarding textsize in mind, from longest to smallest
- function sizersort($a,$b) {
- if (strlen($a)==strlen($b)) {
- return 0;
- }
- return (strlen($a) > strlen($b)) ? -1 : 1;
- }
- # check whether some files have been added/removed
- function AutoLinkListUpdate($group) {
- global $AutoLinkTime,$AutoLinkList,$WorkDir,$SearchPatterns,$AutoLinkMinSize;
- $modified = false;
- $filename = "$WorkDir/.autolink-$group";
- if ($handle = opendir($WorkDir)) { # get filenames that are matching
- while (false !== ($file = readdir($handle))) {
- if ($file != "." && $file!= ".." && substr($file,0,strlen($group)+1) == "$group.") {
- $count=0;
- if (isset($SearchPatterns['default'])) {
- foreach($SearchPatterns['default'] as $v) { #check for in search excluded files
- $count += preg_match($v,$file);
- }
- }
- if ($count==0) { #save only not excluded files
- $matches[]=$file;
- }
- }
- }
- closedir($handle);
- }
- # check if the filename/title combination is already included, if not, add it, check also for changes
- foreach($matches as $v){
- if (file_exists($v) && filemtime($v) >= $AutoLinkTime){
- unset($AutoLinkList[$v]);
- }
- if (empty($AutoLinkList[$v])) { # add only missing entries
- $modified = true;
- $page = ReadPage($v, READPAGE_CURRENT);
- if (empty($page['title'])){
- $AutoLinkList[$v] = substr(strstr($v,"."),1);
- }
- else {
- $AutoLinkList[$v] = trim($page['title']);
- }
- if (strlen($AutoLinkList[$v])<$AutoLinkMinSize) {
- unset($AutoLinkList[$v]);
- }
- }
- }
- # save filename/title combinations
- if ($modified) {
- if ($fp=@gzopen($filename, "w")) {
- foreach($AutoLinkList as $k => $v) {
- if (substr($k,0,strpos($k,".")) == $group) {
- gzwrite($fp, "$k%0a$v\n");
- }
- }
- gzclose ($fp);
- }
- }
- }
- #replace with pagenames
- function AutoLinkSet($pattern) {
- global $AutoLinkList,$pagename;
- # convert Pattern to Link, ignore selflinks
- foreach ($AutoLinkList as $k => $v) {
- if ($v==$pattern ) {
- return ($k!=$pagename) ? MakeLink($pagename,$k,$v) : $pattern;
- }
- }
- }
- # activate automatic link creation
- function AutoLinkActivate($groups) {
- global $AutoLinkList,$WorkDir;
- $group = explode (" ",$groups);
- foreach ($group as $v) {
- AutoLinkListRead($v);
- AutoLinkListUpdate($v);
- }
- unset($AutoLinkList[""]); # remove empty entry
- # check whether files do exist, if not remove from filename/title list
- foreach($AutoLinkList as $k => $v) { #0,1 sec
- if (!file_exists("$WorkDir/$k")) {
- unset($AutoLinkList[$k]);
- }
- }
- uasort($AutoLinkList,"sizersort"); # sort array on size, largest entries first
- $AutoLinkPattern = implode("|",array_unique($AutoLinkList));
- $searcharray = array("\\", "^", "$", ".", "[" , "]", "(", ")", "?", "*", "+", "{", "}", "/" );
- $replacearray = array("\\\\", "\^", "\\$", "\.", "\[", "\]", "\(", "\)", "\?", "\*", "\+", "\{", "\}", "\/");
- $AutoLinkPattern = str_replace($searcharray,$replacearray,$AutoLinkPattern);
- Markup('autolinklinks', '>wikilink' ,"/($AutoLinkPattern)/e","Keep(AutoLinkSet('$0'),'L')");
- }
Espero que se me haya entendido porque no estoy muy ducho en php.
www.wikimoto.es
en un pmwiki
_________________________________
WebMaster:: EliteMoviles
phpbb 3.0.3
Server:: Sotem
Plantilla basada en subsilver2
WebMaster:: ClubiFone
phpbb 3.0.3
Server:: VPS de pago zipservers
Plantilla basada en subsilver2



















































