#246 - project tagging
Type Feature
Status Closed
Milestone 3.0
Version 2.3.2
Component Tickets
Priority Low
Severity Minor
Assigned to -
Reported 11 years ago
Updated 10 years ago
Votes 0
Related tickets
Proposed time
Worked time

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)#", "<a href='project/url'>$1</a>", $text); } [/code]

Ticket History

11 years and 11 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

11 years and 11 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", '<a href="' . $uri->anchor($project['slug'], 'tickets') . '">$1</a>', $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 11 years and 10 months ago