aboutsummaryrefslogtreecommitdiff
path: root/h-source/Application/Include/myFunctions.php
diff options
context:
space:
mode:
Diffstat (limited to 'h-source/Application/Include/myFunctions.php')
-rw-r--r--h-source/Application/Include/myFunctions.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/h-source/Application/Include/myFunctions.php b/h-source/Application/Include/myFunctions.php
index 7e509cd..5c64317 100644
--- a/h-source/Application/Include/myFunctions.php
+++ b/h-source/Application/Include/myFunctions.php
@@ -392,3 +392,23 @@ function goToModeratedItem( $row = array() )
}
return 'http://'.DOMAIN_NAME.'/'.$url;
}
+
+function getUrlsFromIdHard($id_hard)
+{
+ $clean['id_hard'] = (int)$id_hard;
+
+ $urlView = "http://".DOMAIN_NAME;
+ $urlTalk = "http://".DOMAIN_NAME;
+
+ $hard = new HardwareModel();
+ $res = $hard->select('type,model')->where(array('id_hard'=>$clean['id_hard']))->send();
+ if (count($res) > 0)
+ {
+ $urlView = "http://".DOMAIN_NAME."/".MyStrings::$reverse[$res[0]['hardware']['type']]."/view/".Lang::$current."/".$clean['id_hard']."/".encodeUrl($res[0]['hardware']['model']);
+
+ $urlTalk = "http://".DOMAIN_NAME."/".MyStrings::$reverse[$res[0]['hardware']['type']]."/talk/".Lang::$current."/".$clean['id_hard'];
+ }
+
+ return array('urlView'=>$urlView,'urlTalk'=>$urlTalk);
+
+} \ No newline at end of file