aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/channel.php3
-rw-r--r--include/text.php38
2 files changed, 41 insertions, 0 deletions
diff --git a/include/channel.php b/include/channel.php
index 2d0231bba..82d500e83 100644
--- a/include/channel.php
+++ b/include/channel.php
@@ -2797,3 +2797,6 @@ function pchan_to_chan($pchan) {
return $chan;
}
+function channel_url($channel) {
+ return (($channel) ? z_root() . '/channel/' . $channel['channel_address'] : z_root());
+}
diff --git a/include/text.php b/include/text.php
index e57450020..c4f253a27 100644
--- a/include/text.php
+++ b/include/text.php
@@ -3412,3 +3412,41 @@ function get_forum_channels($uid) {
return $r;
}
+
+function print_array($arr, $level = 0) {
+
+ $o = EMPTY_STR;
+ $tabs = EMPTY_STR;
+
+ if(is_array($arr)) {
+ for($x = 0; $x <= $level; $x ++) {
+ $tabs .= "\t";
+ }
+ $o .= '[' . "\n";
+ if(count($arr)) {
+ foreach($arr as $k => $v) {
+ if(is_array($v)) {
+ $o .= $tabs . '[' . $k . '] => ' . print_array($v, $level + 1) . "\n";
+ }
+ else {
+ $o .= $tabs . '[' . $k . '] => ' . print_val($v) . ",\n";
+ }
+ }
+ }
+ $o .= substr($tabs,0,-1) . ']' . (($level) ? ',' : ';' ). "\n";
+ return $o;
+ }
+
+}
+
+function print_val($v) {
+ if(is_bool($v)) {
+ if($v) return 'true';
+ return 'false';
+ }
+ if(is_string($v)) {
+ return "'" . $v . "'";
+ }
+ return $v;
+
+}