diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-10-12 01:34:18 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-10-12 01:34:18 +0000 |
commit | 2a8cbedade6d2d7e7e71e5dbb8c562a84cfe6c80 (patch) | |
tree | 1c4b2060e96fcf4a92f0ab52dbe3894d3797bebd /lib | |
parent | 80d226853c000229cdcd3690885aea2116f8e2cc (diff) | |
download | ampache-2a8cbedade6d2d7e7e71e5dbb8c562a84cfe6c80.tar.gz ampache-2a8cbedade6d2d7e7e71e5dbb8c562a84cfe6c80.tar.bz2 ampache-2a8cbedade6d2d7e7e71e5dbb8c562a84cfe6c80.zip |
new rating hotness, has some bugs will continue to hash them out
Diffstat (limited to 'lib')
-rw-r--r-- | lib/init.php | 7 | ||||
-rw-r--r-- | lib/ui.lib.php | 17 |
2 files changed, 24 insertions, 0 deletions
diff --git a/lib/init.php b/lib/init.php index f76f3eb6..e88da245 100644 --- a/lib/init.php +++ b/lib/init.php @@ -255,6 +255,13 @@ else { $user = new user(); } + +/* Add in some variables for ajax done here because we need the user */ +$ajax_info['ajax_url'] = $results['web_path'] . '/server/ajax.server.php'; +$ajax_info['ajax_info'] = '&user_id=' . $user->id . '&sessid=' . session_id(); +conf($ajax_info); +unset($ajax_info); + // Load gettext mojo load_gettext(); diff --git a/lib/ui.lib.php b/lib/ui.lib.php index 47b6cff9..1834dc35 100644 --- a/lib/ui.lib.php +++ b/lib/ui.lib.php @@ -1353,6 +1353,23 @@ function xml_from_array($array) { } // xml_from_array +/** + * show_ajax_js + * This displays the javascript array definition needed + * For ajax to know what it should be replacing + */ +function show_ajax_js($name,$array) { + + $elements = count($array); + + echo "<script type=\"text/javascript\" language=\"javascript\">\n"; + echo "<!--\n"; + echo "var $name = new Array($elements);\n"; + foreach ($array as $key=>$value) { + echo $name . "[$key] = \"$value\";\n"; + } + echo "-->\n</script>\n"; +} // show_ajax_js ?> |