Changeset 1324 in ExiteCMS for modules/ExiteCMS/tracsvn/php-files/modules/tracsvn/tracsvn_include.php
- Timestamp:
- 02/28/08 15:19:38 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/ExiteCMS/tracsvn/php-files/modules/tracsvn/tracsvn_include.php
r1320 r1324 39 39 function tracsvn_wiki2html($text) { 40 40 41 // get rid of double line breaks42 $text = str_replace("[[BR]]\r\n", "",$text);41 // get rid of trailing whitespace 42 $text = rtrim($text); 43 43 // bullit implies line break 44 $text = str_replace("\r\*", "\*", $text); 44 $text = str_replace("\r\n*", "*", $text); 45 $text = str_replace("[[BR]]*", "*", $text); 45 46 // bullet lists 47 $text = str_replace("\r\n *", "<br />*", $text); 46 48 $text = preg_replace("/\*\s(.*?)(\w)/i", "• \\1\\2", $text); 47 // line breaks 48 $text = str_replace("\r\n", "<br />", $text); 49 // convert linebreaks 50 if (FUSION_SELF == "trac.php") { 51 $text = str_replace("\r\n", "<br />", $text); 52 $text = str_replace("\n", "<br />", $text); 53 } else { 54 $text = str_replace("\r\n", "<br /><img src='".THEME."images/bullet.gif' alt=\"\" /> ", $text); 55 $text = str_replace("\n", "<br /><img src='".THEME."images/bullet.gif' alt=\"\" /> ", $text); 56 } 57 // forced line breaks 58 $text = str_replace("[[BR]]", "<br />", $text); 49 59 // strike-through 50 60 $text = preg_replace("/~~(.*?)~~/si", "<span style='text-decoration:line-through;'>\\1</span>", $text); … … 71 81 $text = preg_replace("/#([0-9]+)/si", "#<a href='trac.php?step=ticket&id=\\1' title=''>\\1</a>", $text); 72 82 } 83 $text = preg_replace("/rev. ([0-9]+)/i", "rev. <a href='svn.php?rev=\\1' title=''>\\1</a>", $text); 73 84 74 85 // return the converted text … … 82 93 83 94 // validate the parameter 84 if (!empty($tracname) && !is_string($tracname)) {95 if (!empty($tracname) && is_string($tracname)) { 85 96 // translate Trac/SVN users to ExiteCMS users if needed 86 $result = dbquery("SELECT u.user_ name FROM ".$db_prefix."users u, ".$db_prefix."tracsvn_alias t WHERE t.tracsvn_userid = u.user_id AND t.tracsvn_username = '$tracname' LIMIT 1");97 $result = dbquery("SELECT u.user_id, u.user_name FROM ".$db_prefix."users u, ".$db_prefix."tracsvn_alias t WHERE t.tracsvn_userid = u.user_id AND t.tracsvn_username = '$tracname' LIMIT 1"); 87 98 if (dbrows($result)) { 88 $data = dbarray($result); 89 $tracname = $data['user_name']; 90 } 91 } 92 93 // test code!!! 94 if ($tracname == "hverton") $tracname = "WanWizard"; 95 if ($tracname == "root") $tracname = "Webmaster"; 96 99 $tracname = dbarray($result); 100 } 101 } 102 // not found? maybe there's a direct link with a member 103 if (!is_array($tracname)) { 104 // check the users table 105 $result = dbquery("SELECT user_id, user_name FROM ".$db_prefix."users WHERE user_name = '$tracname' LIMIT 1"); 106 if (dbrows($result)) { 107 $tracname = dbarray($result); 108 } 109 } 110 111 // still not found? Use the tracname 112 if (!is_array($tracname)) { 113 $tracname = array('user_id' => '0', 'user_name' => $tracname); 114 } 115 97 116 return $tracname; 98 117 }
Note: See TracChangeset
for help on using the changeset viewer.
