#246 - project tagging

Description

What does this feature do? Ability to tag other projects in tickets, simply by adding something like

traq-3 would automatically parse it to a link to a view of the project traq-3

I have already added this functionality to my installation whereas I only need to type a projects code name (no styling like above) and then it just links me to /views/%themedir%/tickets.php

All I did was add a function to get all the codenames then something like (away from server atm): [code] //formattext() foreach($project_codenames as $codename) { $text = preg_replace("#($codename)#", "$1", $text); } [/code]

Activity

13 years and 9 months ago by Devon Hazelett

O_o soo thats the infamous _interwikilinks callback function huh, never been able to figure out what it was parsing lol. well for those of you who dont know that was [ [ traq-3 ] ] without spaces; so i guess adding the square bracket format is out of the question; but you could always parse the same way I do :D

13 years and 9 months ago by Devon Hazelett

as a matter of fact heres the whole thing

[code]formattext() { $codenames = project_codenames($project['id']); foreach($codenames as $codename) { $text = preg_replace("#(\b" . $codename['codename'] . "\b)#i", '$1', $text); }

//This is just a clone of project_milestones() function project_codenames($project_id=NULL) { global $project, $db; $project_id = ($project_id == NULL ? $project['id'] : $project_id);

$codenames = array();
$fetch = $db->query("SELECT * FROM `".DBPF."projects` WHERE `id`='".$db->res($project_id)."'");
while($info = $db->fetcharray($fetch))
	$codenames[] = $info;
return $codenames;

} }[/code]

Jack closed as Closed 13 years and 7 months ago

Status

Closed
-
Low

Details

Feature
3.0
Tickets
2.3.2
Minor

Tracking

Devon Hazelett
13 years and 9 months ago
12 years and 1 month ago
0
-
-