예제 #1
0
/**
 * Formatter data så det kan brukes i JavaScript variabler osv
 * Ikke UTF-8 (slik som json_encode)
 *
 * @param string $value
 */
function js_encode($value)
{
    if (is_null($value)) {
        return 'null';
    }
    if ($value === false) {
        return 'false';
    }
    if ($value === true) {
        return 'true';
    }
    if (is_scalar($value)) {
        if (is_string($value)) {
            static $json_replace_from = array("\\", '"', "/", "", "\f", "\n", "\r", "\t");
            static $json_replace_to = array("\\\\", '\\"', "\\/", "\\b", "\\f", "\\n", "\\r", "\\t");
            return '"' . str_replace($json_replace_from, $json_replace_to, $value) . '"';
        }
        return $value;
    }
    if (!is_array($value) && !is_object($value)) {
        return false;
    }
    $object = false;
    for ($i = 0, reset($value), $len = count($value); $i < $len; $i++, next($value)) {
        if (key($value) !== $i) {
            $object = true;
            break;
        }
    }
    $result = array();
    if ($object) {
        foreach ($value as $k => $v) {
            $result[] = js_encode($k) . ':' . js_encode($v);
        }
        return '{' . implode(",", $result) . '}';
    }
    foreach ($value as $v) {
        $result[] = js_encode($v);
    }
    return '[' . implode(",", $result) . ']';
}
예제 #2
0
function to_js($var, $tabs = 0)
{
    if (is_numeric($var)) {
        return $var;
    }
    if (is_string($var)) {
        return "'" . js_encode($var) . "'";
    }
    if (is_array($var)) {
        $useObject = false;
        foreach (array_keys($var) as $k) {
            if (!is_numeric($k)) {
                $useObject = true;
            }
        }
        $js = array();
        foreach ($var as $k => $v) {
            $i = "";
            if ($useObject) {
                if (preg_match('#[a-zA-Z]+[a-zA-Z0-9]*#', $k)) {
                    $i .= "{$k}: ";
                } else {
                    $i .= "'{$k}': ";
                }
            }
            $i .= to_js($v, $tabs + 1);
            $js[] = $i;
        }
        if ($useObject) {
            $ret = "{\n" . tabify(implode(",\n", $js), $tabs) . "\n}";
        } else {
            $ret = "[\n" . tabify(implode(",\n", $js), $tabs) . "\n]";
        }
        return $ret;
    }
    return 'null';
}
예제 #3
0
require "../../app/ajax.php";
ajax::require_user();
// kontroller lås
ajax::validate_lock();
// hent alle utfordringer
$result = \Kofradia\DB::get()->query("SELECT poker_id, poker_starter_up_id, poker_time_start, poker_starter_cards, poker_cash FROM poker WHERE poker_state = 2 ORDER BY poker_cash");
$i = 0;
$data = array();
$html_to_parse = array();
while ($row = $result->fetch()) {
    $d = array();
    $d['self'] = $row['poker_starter_up_id'] == login::$user->player->id;
    $html_to_parse[$i] = (!$d['self'] ? '<input type="radio" name="id" value="' . $row['poker_id'] . '" />' : '') . '<user id="' . $row['poker_starter_up_id'] . '" />';
    $d['cash'] = game::format_cash($row['poker_cash']);
    $d['reltime'] = poker_round::get_time_text($row['poker_time_start']);
    if (access::has("admin")) {
        $cards = new CardsPoker(explode(",", $row['poker_starter_cards']));
        $d['cards'] = $cards->solve_text($cards->solve());
    }
    $data[$i++] = $d;
}
// parse html
if (count($html_to_parse) > 0) {
    $html_to_parse = parse_html_array($html_to_parse);
    foreach ($html_to_parse as $i => $value) {
        $data[$i]['player'] = $value;
    }
}
ajax::text(js_encode($data), ajax::TYPE_OK);
예제 #4
0
							$('#link').removeAttr('disabled');
							$('#titleinput').show();
							$('#include_li_label').show();
							break;
						case 'html':
							$('#albumselector,#pageselector,#categoryselector,#custompageselector,#span_row').hide();
							$('#selector').html('<?php 
echo js_encode(gettext("HTML"));
?>
');
							$('#description').html('<?php 
echo js_encode(gettext('Inserts custom HTML.'));
?>
');
							$('#link_label').html('<?php 
echo js_encode(gettext('HTML'));
?>
');
							$('#link').removeAttr('disabled');
							$('#titleinput').show();
							$('#include_li_label').show();
							break;
						case "":
							$("#selector").html("");
							$("#add").hide();
							break;
					}
				}
				//]]> -->
			</script>
			<script type="text/javascript">
예제 #5
0
/**
 * Echo js_encode string;
 *
 * @param string $text 
 * @return string
*/
function js_echo($text)
{
    echo js_encode($text);
}
예제 #6
0
?>
;
							var newuser = $('#adminuser' + newuserid).val().replace(/^\s+|\s+$/g, "");
							if (newuser == '')
								return true;
							if (newuser.indexOf('?') >= 0 || newuser.indexOf('&') >= 0 || newuser.indexOf('"') >= 0 || newuser.indexOf('\'') >= 0) {
								alert('<?php 
echo js_encode(gettext('User names may not contain “?”, “&", or quotation marks.'));
?>
');
								return false;
							}
							for (i = 0; i < admins.length; i++) {
								if (admins[i] == newuser) {
									alert(sprintf('<?php 
echo js_encode(gettext('The user “%s” already exists.'));
?>
', newuser));
									return false;
								}
							}
							return true;
						}
						// ]]> -->
					</script>

					<br class="clearall" />
					<br />
				</div><!-- end of tab_admin div -->

			</div><!-- end of container -->
예제 #7
0
			return true;
		}
	}
	function toggleTitlelink() {
		if(jQuery('#edittitlelink:checked').val() == 1) {
			$('#titlelink').removeAttr("disabled");
		} else {
			$('#titlelink').attr("disabled", true);
		}
	};
	$(document).ready(function() {
		$('form [name=checkeditems] #checkallaction').change(function(){
			if($(this).val() == 'deleteall') {
				// general text about "items" so it can be reused!
				alert('<?php 
echo js_encode(gettext('Are you sure you want to delete all selected items? THIS CANNOT BE UNDONE!'));
?>
');
			}
		});
	});
	// ]]> -->
</script>
</head>
<body>
<?php 
printLogoAndLinks();
?>
<div id="main">
	<?php 
printTabs();
예제 #8
0
/**
 * puts out a row in the edit album table
 *
 * @param object $album is the album being emitted
 * @param bool $show_thumb set to false to show thumb standin image rather than album thumb
 * @param object $owner the parent album (or NULL for gallery)
 *
 * */
function printAlbumEditRow($album, $show_thumb, $owner)
{
    global $_zp_current_admin_obj;
    $enableEdit = $album->subRights() & MANAGED_OBJECT_RIGHTS_EDIT;
    if (is_object($owner)) {
        $owner = $owner->name;
    }
    ?>
		<div class='page-list_row'>

			<div class="page-list_albumthumb">
				<?php 
    if ($show_thumb) {
        $thumbimage = $album->getAlbumThumbImage();
        $thumb = getAdminThumb($thumbimage, 'small');
    } else {
        $thumb = 'images/thumb_standin.png';
    }
    if ($enableEdit) {
        ?>
					<a href="?page=edit&amp;album=<?php 
        echo html_encode(pathurlencode($album->name));
        ?>
" title="<?php 
        echo sprintf(gettext('Edit this album: %s'), $album->name);
        ?>
">
						<?php 
    }
    ?>
					<img src="<?php 
    echo html_encode(pathurlencode($thumb));
    ?>
" width="<?php 
    echo ADMIN_THUMB_SMALL;
    ?>
" height="<?php 
    echo ADMIN_THUMB_SMALL;
    ?>
" alt="" title="album thumb" />
					<?php 
    if ($enableEdit) {
        ?>
					</a>
					<?php 
    }
    ?>
			</div>
			<div class="page-list_albumtitle">
				<?php 
    if ($enableEdit) {
        ?>
					<a href="?page=edit&amp;album=<?php 
        echo html_encode(pathurlencode($album->name));
        ?>
" title="<?php 
        echo sprintf(gettext('Edit this album: %s'), $album->name);
        ?>
">
						<?php 
    }
    echo html_encode(getBare($album->getTitle()));
    if ($enableEdit) {
        ?>
					</a>
					<?php 
    }
    ?>
			</div>
			<?php 
    if ($album->isDynamic()) {
        $imgi = '<img src="images/pictures_dn.png" alt="" title="' . gettext('images') . '" />';
        $imga = '<img src="images/folder_picture_dn.png" alt="" title="' . gettext('albums') . '" />';
    } else {
        $imgi = '<img src="images/pictures.png" alt="" title="' . gettext('images') . '" />';
        $imga = '<img src="images/folder_picture.png" alt="" title="' . gettext('albums') . '" />';
    }
    $ci = count($album->getImages());
    $si = sprintf('%1$s <span>(%2$u)</span>', $imgi, $ci);
    if ($ci > 0 && !$album->isDynamic()) {
        $si = '<a href="?page=edit&amp;album=' . html_encode(pathurlencode($album->name)) . '&amp;tab=imageinfo" title="' . gettext('Subalbum List') . '">' . $si . '</a>';
    }
    $ca = $album->getNumAlbums();
    $sa = sprintf('%1$s <span>(%2$u)</span>', $imga, $ca);
    if ($ca > 0 && !$album->isDynamic()) {
        $sa = '<a href="?page=edit&amp;album=' . html_encode(pathurlencode($album->name)) . '&amp;tab=subalbuminfo" title="' . gettext('Subalbum List') . '">' . $sa . '</a>';
    }
    ?>
			<div class="page-list_extra">
				<?php 
    echo $sa;
    ?>
			</div>
			<div class="page-list_extra">
				<?php 
    echo $si;
    ?>
			</div>
			<?php 
    $wide = '40px';
    ?>
			<div class="page-list_iconwrapperalbum">
				<div class="page-list_icon">
					<?php 
    $pwd = $album->getPassword();
    if (!empty($pwd)) {
        echo '<a title="' . gettext('Password protected') . '"><img src="images/lock.png" style="border: 0px;" alt="" title="' . gettext('Password protected') . '" /></a>';
    }
    ?>
				</div>
				<div class="page-list_icon">
					<?php 
    echo linkPickerIcon($album);
    ?>
				</div>
				<div class="page-list_icon">
					<?php 
    if ($album->getShow()) {
        if ($enableEdit) {
            ?>
							<a href="?action=publish&amp;value=0&amp;album=<?php 
            echo html_encode(pathurlencode($album->name));
            ?>
&amp;return=*<?php 
            echo html_encode(pathurlencode($owner));
            ?>
&amp;XSRFToken=<?php 
            echo getXSRFToken('albumedit');
            ?>
" title="<?php 
            echo sprintf(gettext('Un-publish the album %s'), $album->name);
            ?>
" >
								<?php 
        }
        ?>
							<img src="images/pass.png" style="border: 0px;" alt="" title="<?php 
        echo gettext('Published');
        ?>
" />
							<?php 
        if ($enableEdit) {
            ?>
							</a>
							<?php 
        }
    } else {
        if ($enableEdit) {
            ?>
							<a href="?action=publish&amp;value=1&amp;album=<?php 
            echo html_encode(pathurlencode($album->name));
            ?>
&amp;return=*<?php 
            echo html_encode(pathurlencode($owner));
            ?>
&amp;XSRFToken=<?php 
            echo getXSRFToken('albumedit');
            ?>
" title="<?php 
            echo sprintf(gettext('Publish the album %s'), $album->name);
            ?>
">
								<?php 
        }
        if ($album->getPublishDate() > date('Y-m-d H:i:s')) {
            ?>
								<img src="images/clock.png" alt="<?php 
            echo gettext("Un-published");
            ?>
" title= "<?php 
            echo gettext("Publish (override scheduling)");
            ?>
" />
								<?php 
        } else {
            ?>
								<img src="images/action.png" style="border: 0px;" alt="" title="<?php 
            echo sprintf(gettext('Unpublished'), $album->name);
            ?>
" />
								<?php 
        }
        if ($enableEdit) {
            ?>
							</a>
							<?php 
        }
    }
    ?>
				</div>
				<div class="page-list_icon">
					<?php 
    if ($album->getCommentsAllowed()) {
        if ($enableEdit) {
            ?>
							<a href="?action=comments&amp;commentson=0&amp;album=<?php 
            echo html_encode($album->getFileName());
            ?>
&amp;return=*<?php 
            echo html_encode(pathurlencode($owner));
            ?>
&amp;XSRFToken=<?php 
            echo getXSRFToken('albumedit');
            ?>
" title="<?php 
            echo gettext('Disable comments');
            ?>
">
								<?php 
        }
        ?>
							<img src="images/comments-on.png" alt="" title="<?php 
        echo gettext("Comments on");
        ?>
" style="border: 0px;"/>
							<?php 
        if ($enableEdit) {
            ?>
							</a>
							<?php 
        }
    } else {
        if ($enableEdit) {
            ?>
							<a href="?action=comments&amp;commentson=1&amp;album=<?php 
            echo html_encode($album->getFileName());
            ?>
&amp;return=*<?php 
            echo html_encode(pathurlencode($owner));
            ?>
&amp;XSRFToken=<?php 
            echo getXSRFToken('albumedit');
            ?>
" title="<?php 
            echo gettext('Enable comments');
            ?>
">
								<?php 
        }
        ?>
							<img src="images/comments-off.png" alt="" title="<?php 
        echo gettext("Comments off");
        ?>
" style="border: 0px;"/>
							<?php 
        if ($enableEdit) {
            ?>
							</a>
							<?php 
        }
    }
    ?>
				</div>
				<div class="page-list_icon">
					<a href="<?php 
    echo WEBPATH;
    ?>
/index.php?album=<?php 
    echo html_encode(pathurlencode($album->name));
    ?>
" title="<?php 
    echo gettext("View album");
    ?>
">
						<img src="images/view.png" style="border: 0px;" alt="" title="<?php 
    echo sprintf(gettext('View album %s'), $album->name);
    ?>
" />
					</a>
				</div>
				<div class="page-list_icon">
					<?php 
    if ($album->isDynamic() || !$enableEdit) {
        ?>
						<img src="images/icon_inactive.png" style="border: 0px;" alt="" title="<?php 
        echo gettext('unavailable');
        ?>
" />
						<?php 
    } else {
        ?>
						<a class="warn" href="admin-refresh-metadata.php?page=edit&amp;album=<?php 
        echo html_encode(pathurlencode($album->name));
        ?>
&amp;return=*<?php 
        echo html_encode(pathurlencode($owner));
        ?>
&amp;XSRFToken=<?php 
        echo getXSRFToken('refresh');
        ?>
" title="<?php 
        echo sprintf(gettext('Refresh metadata for the album %s'), $album->name);
        ?>
">
							<img src="images/refresh.png" style="border: 0px;" alt="" title="<?php 
        echo sprintf(gettext('Refresh metadata in the album %s'), $album->name);
        ?>
" />
						</a>
						<?php 
    }
    ?>
				</div>
				<?php 
    if (extensionEnabled('hitcounter')) {
        ?>
					<div class="page-list_icon">
						<?php 
        if (!$enableEdit) {
            ?>
							<img src="images/icon_inactive.png" style="border: 0px;" alt="" title="<?php 
            echo gettext('unavailable');
            ?>
" />
							<?php 
        } else {
            ?>
							<a class="reset" href="?action=reset_hitcounters&amp;albumid=<?php 
            echo $album->getID();
            ?>
&amp;album=<?php 
            echo html_encode(pathurlencode($album->name));
            ?>
&amp;subalbum=true&amp;return=*<?php 
            echo html_encode(pathurlencode($owner));
            ?>
&amp;XSRFToken=<?php 
            echo getXSRFToken('hitcounter');
            ?>
" title="<?php 
            echo sprintf(gettext('Reset hit counters for album %s'), $album->name);
            ?>
">
								<img src="images/reset.png" style="border: 0px;" alt="" title="<?php 
            echo sprintf(gettext('Reset hit counters for the album %s'), $album->name);
            ?>
" />
							</a>
							<?php 
        }
        ?>
					</div>
					<?php 
    }
    ?>
				<div class="page-list_icon">
					<?php 
    $myalbum = $_zp_current_admin_obj->getAlbum();
    $supress = !zp_loggedin(MANAGE_ALL_ALBUM_RIGHTS) && $myalbum && $album->getID() == $myalbum->getID();
    if (!$enableEdit || $supress) {
        ?>
						<img src="images/icon_inactive.png" style="border: 0px;" alt="" title="<?php 
        echo gettext('unavailable');
        ?>
" />
						<?php 
    } else {
        ?>
						<a class="delete" href="javascript:confirmDeleteAlbum('?page=edit&amp;action=deletealbum&amp;album=<?php 
        echo urlencode(pathurlencode($album->name));
        ?>
&amp;return=<?php 
        echo html_encode(pathurlencode($owner));
        ?>
&amp;XSRFToken=<?php 
        echo getXSRFToken('delete');
        ?>
');" title="<?php 
        echo sprintf(gettext("Delete the album %s"), js_encode($album->name));
        ?>
">
							<img src="images/fail.png" style="border: 0px;" alt="" title="<?php 
        echo sprintf(gettext('Delete the album %s'), js_encode($album->name));
        ?>
" />
						</a>
						<?php 
    }
    ?>
				</div>
				<?php 
    if ($enableEdit) {
        ?>
					<div class="page-list_icon">
						<input class="checkbox" type="checkbox" name="ids[]" value="<?php 
        echo $album->getFileName();
        ?>
" onclick="triggerAllBox(this.form, 'ids[]', this.form.allbox);" <?php 
        if ($supress) {
            echo ' disabled="disabled"';
        }
        ?>
 />
					</div>
					<?php 
    }
    ?>
			</div>
		</div>
		<?php 
}
    static function getJS()
    {
        $message = gettext_pl('This website uses cookies. By continuing to browse the site, you agree to our use of cookies.', 'zp_cookieconsent');
        if (getOption('zpcookieconsent_message')) {
            $message = get_language_string(getOption('zpcookieconsent_message'));
        }
        $dismiss = gettext_pl('Agree', 'zp_cookieconsent');
        if (getOption('zpcookieconsent_buttonagree')) {
            $dismiss = get_language_string(getOption('zpcookieconsent_buttonagree'));
        }
        $learnmore = gettext_pl('More info', 'zp_cookieconsent');
        if (getOption('zpcookieconsent_buttonlearnmore')) {
            $learnmore = get_language_string(getOption('zpcookieconsent_buttonlearnmore'));
        }
        $link = getOption('zpcookieconsent_buttonlearnmorelink');
        $theme = '';
        if (getOption('zpcookieconsent_theme')) {
            $theme = FULLWEBPATH . '/' . USER_PLUGIN_FOLDER . '/zp_cookieconsent/styles/' . getOption('zpcookieconsent_theme') . '.css';
        }
        $domain = '';
        if (getOption('zpcookieconsent_domain')) {
            $domain = getOption('zpcookieconsent_domain');
        }
        $DoC = false;
        if (getOption('zpcookieconsent_dismissonclick')) {
            $DoC = true;
        }
        $DoS = false;
        if (getOption('zpcookieconsent_dismissonscroll') & !strpos($link, $_SERVER['REQUEST_URI'])) {
            // false in Cookie Policy Page
            $DoS = true;
        }
        ?>
		<script>
    window.cookieconsent_options = {
				message: '<?php 
        echo js_encode($message);
        ?>
',
				dismiss: '<?php 
        echo js_encode($dismiss);
        ?>
',
        learnMore: '<?php 
        echo $learnmore;
        ?>
',
				theme: '<?php 
        echo $theme;
        ?>
',
        link: '<?php 
        echo html_encode($link);
        ?>
',
				domain: '<?php 
        echo $domain;
        ?>
',
				expiryDays: <?php 
        echo getOption('zpcookieconsent_expirydays');
        ?>
    };
<?php 
        if ($DoC || $DoS) {
            // dismiss on-click or on-scroll
            if ($DoC) {
                // dismiss on-click
                ?>
			$('a').not('[href*=#]').on('click', DismissOnClick);

			function DismissOnClick() {
				var isInternalLink = new RegExp('/' + window.location.host + '/');
				if ( isInternalLink.test(this.href)) {
					fatto(0);
				}
			}
<?php 
            }
            if ($DoS) {
                // Dismiss on-scroll
                ?>
			var IniScroll, noHurry;
			$(window).load(function (){
				if(noHurry) {
					window.clearTimeout(noHurry);
				}
				noHurry = window.setTimeout(function() {
					IniScroll = $(window).scrollTop();
					$(window).on("scroll",DismissOnScroll);
				}, 500);
			});

			function DismissOnScroll() {
				var NewScroll = $(window).scrollTop();
				if (Math.abs(NewScroll - IniScroll) > <?php 
                echo getOption('zpcookieconsent_scrollrange');
                ?>
) {
					fatto(1);
				}
			}
<?php 
            }
            // Unbind and simulate dismiss button
            ?>
		function fatto (FromScroll) {
<?php 
            if ($DoC) {
                ?>
			$('a').off('click', DismissOnClick);

			if ($('.cc_btn_accept_all').length &! FromScroll) {
				$('.cc_btn_accept_all')[0].click();
			}
<?php 
            }
            if ($DoS) {
                ?>
			$(window).off("scroll", DismissOnScroll);

			if ($('.cc_btn_accept_all').length && FromScroll) {
				fadeOut(document.querySelector(".cc_banner-wrapper"));
			}
			function fadeOut(el){
				el.style.opacity = 1;
				(function fade() {
					if ((el.style.opacity -= 1/25) < 0) {
						$('.cc_btn_accept_all')[0].click();
					} else if (window.requestAnimationFrame){
						requestAnimationFrame(fade);
					} else {
						$('.cc_btn_accept_all')[0].click();
					}
				})();
			}
<?php 
            }
            ?>
		}
<?php 
        }
        ?>
		</script>
		<script src="<?php 
        echo FULLWEBPATH . '/' . USER_PLUGIN_FOLDER;
        ?>
/zp_cookieconsent/cookieconsent.min.js"></script>
		<?php 
    }
예제 #10
0
/**
 * Causes a Google map to be printed based on the gps data in all the images in the album
 * @param  string $zoomlevel the zoom in for the map. NULL will use the default
 * @param string $defaultmaptype the starting display of the map valid values are G_NORMAL_MAP | G_SATELLITE_MAP | G_HYBRID_MAP | G_PHYSICAL_MAP | G_SATELLITE_3D_MAP
 * @param int $width is the image width of the map. NULL will use the default
 * @param int $height is the image height of the map. NULL will use the default
 * @param string $text text for the pop-up link
 * @param bool $toggle set to true to hide initially
 * @param string $id DIV id
 * @param int $firstPageImages the number of images on transition pages.
 * @param array $mapselections array of the maps to be used.
 * @param bool $addphysical Adds physical map.
 * @param bool $addwiki Adds wikipedia georeferenced data on your maps
 * @param string $background the background color for the map
 * @param string $mapcontrol values None | Small | Large
 * @param string $maptypecontrol values Buttons | List
 * @param string $customJS the extra javascript needed by the theme
 */
function printAlbumMap($zoomlevel = NULL, $defaultmaptype = NULL, $width = NULL, $height = NULL, $text = '', $toggle = true, $id = 'googlemap', $firstPageImages = 0, $mapselections = NULL, $addwiki = NULL, $background = NULL, $mapcontrol = NULL, $maptypecontrol = NULL, $customJS = NULL)
{
    global $_zp_phoogle, $_zp_images, $_zp_current_album, $_zp_current_image;
    if (getOption('gmaps_apikey') != '') {
        $foundLocation = false;
        $defaultmaptype = setupAllowedMaps($defaultmaptype, $mapselections);
        if ($zoomlevel) {
            $_zp_phoogle->zoomLevel = $zoomlevel;
        }
        if (!is_null($width)) {
            $_zp_phoogle->setWidth($width);
        } else {
            $_zp_phoogle->setWidth(getOption('gmaps_width'));
        }
        if (!is_null($height)) {
            $_zp_phoogle->setHeight($height);
        } else {
            $_zp_phoogle->setHeight(getOption('gmaps_height'));
        }
        if (!is_null($mapcontrol)) {
            $_zp_phoogle->setControlMap($mapcontrol);
        } else {
            $_zp_phoogle->setControlMap(getOption('gmaps_control'));
        }
        if (!is_null($maptypecontrol)) {
            $_zp_phoogle->setControlMapType($maptypecontrol);
        } else {
            $_zp_phoogle->setControlMapType(getOption('gmaps_control_maptype'));
        }
        if (!is_null($background)) {
            $_zp_phoogle->setBackGround($background);
        } else {
            $_zp_phoogle->setBackGround(getOption('gmaps_background'));
        }
        if (!is_null($customJS)) {
            $_zp_phoogle->customJS = $customJS;
        }
        resetCurrentAlbum();
        // start from scratch
        while (next_image(getOption('gmaps_show_all_album_points'), $firstPageImages)) {
            $exif = getImageEXIFData();
            if (!empty($exif['EXIFGPSLatitude']) && !empty($exif['EXIFGPSLongitude'])) {
                $foundLocation = true;
                $lat = $exif['EXIFGPSLatitude'];
                $long = $exif['EXIFGPSLongitude'];
                if ($exif['EXIFGPSLatitudeRef'] == 'S') {
                    $lat = '-' . $lat;
                }
                if ($exif['EXIFGPSLongitudeRef'] == 'W') {
                    $long = '-' . $long;
                }
                $infoHTML = '<a href="' . pathurlencode(getImageLinkURL()) . '"><img src="' . pathurlencode(getImageThumb()) . '" alt="' . getImageDesc() . '" ' . 'style=" margin-left: 30%; margin-right: 10%; border: 0px; "/></a>' . '<p>' . getImageDesc() . '</p>';
                addPoint($lat, $long, js_encode($infoHTML));
            }
        }
        resetCurrentAlbum();
        // clear out any 'damage'
        if ($foundLocation) {
            $dataid = $id . '_data';
            //to avoid problems with google earth and the toggle options, the toggle option is removed from here when GE is activated
            //it is possible to have both functionnality work but the toogle option should then be integrated in the phoogle map class dirctly within the script
            //that calls the map and should alos trigger a map type change. check Sobre theme or  have alook at www.kaugite.com for an example
            $toggle = $toggle && $defaultmaptype != 'G_SATELLITE_3D_MAP';
            if (is_null($text)) {
                $text = gettext('Google Map');
            }
            echo "<a href=\"javascript: vtoggle('{$dataid}');\" title=\"" . gettext('Display or hide the Google Map.') . "\">";
            echo $text;
            echo "</a>\n";
            echo "  <div id=\"{$dataid}\"" . ($toggle ? " style=\"color:black; visibility: hidden;position:absolute;left: -3000px;top: -3000px\"" : '') . ">\n";
            $_zp_phoogle->showMap(is_null($zoomlevel));
            echo "  </div>\n";
        }
    }
}
예제 #11
0
파일: banken.php 프로젝트: Kuzat/kofradia
    /**
     * Vis banken
     */
    protected function show()
    {
        ess::$b->page->add_js('
var user_bank = ' . js_encode(game::format_cash($this->up->data['up_bank'])) . ';
var user_cash = ' . js_encode(game::format_cash($this->up->data['up_cash'])) . ';');
        ess::$b->page->add_js_domready('
	$$(".bank_amount_set").each(function(elm)
	{
		var amount = elm.get("rel").substring(0, 4) == "bank" ? user_bank : user_cash;
		var e_id = elm.get("rel").substring(5);
		elm
			.appendText(" (")
			.grab(new Element("a", {"text":"alt"}).addEvent("click", function()
			{
				$(e_id).set("value", amount);
			}))
			.appendText(")");
	});');
        echo '
<div class="bg1_c small" style="width: 420px">
	<h1 class="bg1">
		Banken
		<span class="left"></span><span class="right"></span>
	</h1>
	<p class="h_left">
		<a href="' . ess::$s['rpath'] . '/node/31">Hjelp</a>
	</p>
	<p class="h_right">' . (!isset(login::$extended_access['authed']) ? '
		<a href="banken?logout">Logg ut av banken</a>' : '') . '
		<a href="banken?authc">Endre pass</a>
	</p>
	<div class="bg1" style="padding: 0 15px">
		<!-- bankkonto informasjon -->
		<div style="width: 50%; margin-left: -5px; float: left">
			<h2 class="bg1">Bankkonto informasjon<span class="left2"></span><span class="right2"></span></h2>
			<div class="bg1">
				<dl class="dd_right">
					<dt>Kontoeier</dt>
					<dd>' . game::profile_link() . '</dd>
					<dt>Bankfirma</dt>
					<dd><a href="ff/?ff_id=' . $this->bank->id . '">' . htmlspecialchars($this->bank->data['ff_name']) . '</a></dd>
					<dt><abbr title="Overføringstap">Overf.tap</abbr></dt>
					<dd>' . $this->bank->overforingstap * 100 . ' %</dd>
					<dt>Plassering</dt>
					<dd>' . (!isset(game::$bydeler[$this->bank->data['br_b_id']]) ? '<span style="color: #777777">Ukjent</span>' : htmlspecialchars(game::$bydeler[$this->bank->data['br_b_id']]['name'])) . '</dd>
					<dt>Balanse</dt>
					<dd>' . game::format_cash($this->up->data['up_bank']) . '</dd>
				</dl>
				<p class="c">
					<a href="javascript:void(0)" onclick="this.parentNode.style.display=\'none\'; document.getElementById(\'bank_stats\').style.display=\'block\'">Vis statistikk</a>
				</p>
				<div id="bank_stats" style="display: none">
					<dl class="dd_right">
						<dt>Sendt</dt>
						<dd>' . game::format_number($this->up->data['up_bank_num_sent']) . ' stk</dd>
						<dd>' . game::format_cash($this->up->data['up_bank_sent']) . '</dd>
					</dl>
					<dl class="dd_right">
						<dt>Mottatt</dt>
						<dd>' . game::format_number($this->up->data['up_bank_num_received']) . ' stk</dd>
						<dd>' . game::format_cash($this->up->data['up_bank_received']) . '</dd>
					</dl>
					<dl class="dd_right">
						<dt>Overskudd</dt>
						<dd>' . game::format_cash($this->up->data['up_bank_profit']) . '</dd>
					</dl>
					<dl class="dd_right">
						<dt><abbr title="Overføringstap">Overf.tap</abbr></dt>
						<dd>' . game::format_cash($this->up->data['up_bank_charge']) . '</dd>
					</dl>
					<dl class="dd_right">
						<dt>Renter</dt>
						<dd>' . game::format_number($this->up->data['up_interest_num']) . ' stk</dd>
						<dd>' . game::format_cash($this->up->data['up_interest_total']) . '</dd>
					</dl>
				</div>
				<form action="" method="post">
					<p class="c">' . show_sbutton("Bytt bank", 'name="switch"') . '</p>
				</form>
			</div>
		</div>
		
		<!-- send penger -->
		<div style="width: 50%; margin-right: -5px; float: right">
			<h2 class="bg1">Send penger<span class="left2"></span><span class="right2"></span></h2>
			<div class="bg1">
				<form action="" method="post">
					<input type="hidden" name="sid" value="' . login::$info['ses_id'] . '" />
					<input type="hidden" name="a" value="send" />
					<dl class="dd_right dl_2x">
						<dt>Mottaker</dt>
						<dd><input type="text" name="mottaker" value="' . htmlspecialchars(postval("mottaker")) . '" class="styled w100" /></dd>
		
						<dt>Kontakt?</dt>
						<dd>
							<select onchange="if(this.value==\'\')var name=prompt(\'Brukernavn?\');else var name=this.value;if(name)document.getElementsByName(\'mottaker\')[0].value=name;this.selectedIndex=0" style="width: 110px; overflow: hidden">
								<option>Velg kontakt</option>';
        foreach (login::$info['contacts'][1] as $row) {
            echo '
								<option value="' . htmlspecialchars($row['up_name']) . '">' . htmlspecialchars($row['up_name']) . '</option>';
        }
        echo '
								<option value="">Egendefinert..</option>
							</select>
						</dd>
		
						<dt class="bank_amount_set" rel="bank,transf_amount">Beløp</dt>
						<dd><input type="text" id="transf_amount" name="amount" class="styled w100" value="' . game::format_cash(postval("amount", 0)) . '" /></dd>
		
						<dt>Melding?</dt>
						<dd><input type="text" name="note" value="' . htmlspecialchars(postval("note")) . '" class="styled w100" maxlength="100" /></dd>';
        // hoppe over overføringsgebyret?
        if (access::is_nostat()) {
            echo '
						<dt>Uten gebyr?</dt>
						<dd><input type="checkbox" name="skip_bog"' . (isset($_POST['skip_bog']) ? ' checked="checked"' : '') . ' /></dd>';
        }
        echo '
					</dl>
					<p class="c">' . show_sbutton("Fortsett") . '</p>
				</form>
			</div>
		</div>
		<div class="clear"></div>
		
		<!-- sett inn penger -->
		<div style="width: 50%; margin-left: -5px; float: left">
			<h2 class="bg1">Sett inn penger<span class="left2"></span><span class="right2"></span></h2>
			<div class="bg1">
				<form action="" method="post">
					<dl class="dd_right">
						<dt class="bank_amount_set" rel="cash,bank_sett_inn">Beløp</dt>
						<dd><input type="text" name="sett_inn" id="bank_sett_inn" class="styled w100" value="0" /></dd>
					</dl>
					<p class="c">' . show_sbutton("Sett inn") . '</p>
				</form>
			</div>
		</div>
		
		<!-- ta ut penger -->
		<div style="width: 50%; margin-right: -5px; float: right">
			<h2 class="bg1">Ta ut penger<span class="left2"></span><span class="right2"></span></h2>
			<div class="bg1">
				<form action="" method="post">
					<dl class="dd_right">
						<dt class="bank_amount_set" rel="bank,bank_ta_ut">Beløp</dt>
						<dd><input type="text" name="ta_ut" id="bank_ta_ut" class="styled w100" value="0" /></dd>
					</dl>
					<p class="c">' . show_sbutton("Ta ut") . '</p>
				</form>
			</div>
		</div>
		<div class="clear"></div>
	</div>
</div>

<div class="bg1_c large" style="margin-top: 40px">
	<h1 class="bg1">Oversikt<span class="left"></span><span class="right"></span></h1>
	<div class="bg1" style="padding: 0 15px">
		<!-- sendte penger -->
		<div style="width: 50%; margin-left: -5px; float: left">
			<h2 class="bg1">Sendte penger<span class="left2"></span><span class="right2"></span></h2>
			<div class="bg1">';
        // sideinformasjon - hent sendte overføringer
        $pagei = new pagei(pagei::ACTIVE_GET, "side_sendte", pagei::PER_PAGE, 8, pagei::TOTAL, $this->up->data['up_bank_num_sent']);
        $result = \Kofradia\DB::get()->query("SELECT bl_receiver_up_id, amount, time FROM bank_log WHERE bl_sender_up_id = " . $this->up->id . " ORDER BY time DESC LIMIT {$pagei->start}, {$pagei->per_page}");
        if ($result->rowCount() == 0) {
            echo '
				<p>
					Ingen sendte overføringer.
				</p>';
        } else {
            echo '
				<table class="table tablemt" width="100%">
					<thead>
						<tr>
							<th>Mottaker</th>
							<th>Beløp</th>
							<th>Tidspunkt</th>
						</tr>
					</thead>
					<tbody>';
            $i = 0;
            while ($row = $result->fetch()) {
                $date = ess::$b->date->get($row['time']);
                echo '
						<tr' . (++$i % 2 == 0 ? ' class="color"' : '') . '>
							<td><user id="' . $row['bl_receiver_up_id'] . '" /></td>
							<td class="r">' . game::format_cash($row['amount']) . '</td>
							<td class="c" style="font-size: 10px">' . $date->format(date::FORMAT_NOTIME) . '<br />' . $date->format("H:i:s") . '</td>
						</tr>';
            }
            echo '
					</tbody>
				</table>
				<p class="c">' . $pagei->pagenumbers(game::address("banken", $_GET, array("side_sendte")) . "#sendte", game::address("banken", $_GET, array("side_sendte"), array("side_sendte" => "_pageid_")) . "#sendte") . '</p>';
        }
        echo '
			</div>
		</div>
		
		<!-- mottatte penger -->
		<div style="width: 50%; margin-right: -5px; float: right">
			<h2 class="bg1">Mottatte penger<span class="left2"></span><span class="right2"></span></h2>
			<div class="bg1">';
        // sideinformasjon - hent mottatte overføringer
        $pagei = new pagei(pagei::ACTIVE_GET, "side_mottatte", pagei::PER_PAGE, 8, pagei::TOTAL, $this->up->data['up_bank_num_received']);
        $result = \Kofradia\DB::get()->query("SELECT bl_sender_up_id, amount, time FROM bank_log WHERE bl_receiver_up_id = " . $this->up->id . " ORDER BY time DESC LIMIT {$pagei->start}, {$pagei->per_page}");
        if ($result->rowCount() == 0) {
            echo '
				<p>
					Ingen mottatte overføringer.
				</p>';
        } else {
            echo '
				<table class="table tablemt" width="100%">
					<thead>
						<tr>
							<th>Sender</th>
							<th>Beløp</th>
							<th>Tidspunkt</th>
						</tr>
					</thead>
					<tbody>';
            $i = 0;
            while ($row = $result->fetch()) {
                $date = ess::$b->date->get($row['time']);
                echo '
						<tr' . (++$i % 2 == 0 ? ' class="color"' : '') . '>
							<td><user id="' . $row['bl_sender_up_id'] . '" /></td>
							<td class="r">' . game::format_cash($row['amount']) . '</td>
							<td class="c" style="font-size: 10px">' . $date->format(date::FORMAT_NOTIME) . '<br />' . $date->format("H:i:s") . '</td>
						</tr>';
            }
            echo '
					</tbody>
				</table>
				<p class="c">' . $pagei->pagenumbers(game::address("banken", $_GET, array("side_mottatte")) . "#mottatte", game::address("banken", $_GET, array("side_mottatte"), array("side_mottatte" => "_pageid_")) . "#mottatte") . '</p>';
        }
        echo '
			</div>
		</div>
		<div class="clear"></div>
	</div>
</div>';
    }
예제 #12
0
<![endif]-->';
    // mootools
    if (MAIN_SERVER) {
        $head .= '
<script src="' . LIB_HTTP . '/mootools/mootools-1.2.x-yc.js" type="text/javascript"></script>';
    } else {
        $head .= '
<script src="' . LIB_HTTP . '/mootools/mootools-1.2.x-core-nc.js" type="text/javascript"></script>
<script src="' . LIB_HTTP . '/mootools/mootools-1.2.x-more-nc.js" type="text/javascript"></script>';
    }
    $head .= '
<script type="text/javascript">var js_mootools_loaded = (new Date).getTime();</script>
<script src="' . ess::$s['relative_path'] . '/js/default.js?update=' . @filemtime(dirname(dirname(dirname("js/default.js")))) . '" type="text/javascript"></script>';
    ess::$b->page->add_js('var serverTime=' . round(microtime(true) + ess::$b->date->timezone->getOffset(ess::$b->date->get()), 3) * 1000 . ',relative_path=' . js_encode(ess::$s['relative_path']) . ',static_link=' . js_encode(STATIC_LINK) . ',imgs_http=' . js_encode(IMGS_HTTP) . ',pcookie=' . js_encode(ess::$s['cookie_prefix']) . ';');
    if (login::$logged_in) {
        ess::$b->page->add_js('var pm_new=' . login::$user->data['u_inbox_new'] . ',log_new=' . (login::$user->player->data['up_log_new'] + login::$user->player->data['up_log_ff_new']) . ',http_path=' . js_encode(ess::$s['http_path']) . ',https_path=' . js_encode(ess::$s['https_path'] ? ess::$s['https_path'] : ess::$s['http_path']) . ',use_https=' . (login::is_force_https() ? "true" : "false") . ';');
    }
    if (defined("LOCK") && LOCK) {
        ess::$b->page->add_js('var theme_lock=true;');
    }
}
// legg til øverst i head
ess::$b->page->head = $head . ess::$b->page->head;
// sett opp nettleser "layout engine" til CSS
$list = array("opera" => "presto", "applewebkit" => "webkit", "msie 8" => "trident6 trident", "msie 7" => "trident5 trident", "msie 6" => "trident4 trident", "gecko" => "gecko");
$class_browser = 'unknown_engine';
$browser = mb_strtolower($_SERVER['HTTP_USER_AGENT']);
foreach ($list as $key => $item) {
    if (mb_strpos($browser, $key) !== false) {
        $class_browser = $item;
        break;
예제 #13
0
 public static function embed_string($name, $data_file, $width = 300, $height = 200)
 {
     return 'swfobject.embedSWF("' . LIB_HTTP . '/ofc/open-flash-chart.swf", ' . js_encode($name) . ', ' . js_encode($width) . ', ' . js_encode($height) . ', "9.0.0", false, {"data-file": "' . urlencode($data_file) . '"});';
 }
    static function getJS()
    {
        $message = gettext_pl('This website uses cookies. By continuing to browse the site, you agree to our use of cookies.', 'zp_cookieconsent');
        if (getOption('zpcookieconsent_message')) {
            $message = get_language_string(getOption('zpcookieconsent_message'));
        }
        $dismiss = gettext_pl('Agree', 'zp_cookieconsent');
        if (getOption('zpcookieconsent_buttonagree')) {
            $dismiss = get_language_string(getOption('zpcookieconsent_buttonagree'));
        }
        $learnmore = gettext_pl('More info', 'zp_cookieconsent');
        if (getOption('zpcookieconsent_buttonlearnmore')) {
            $learnmore = get_language_string(getOption('zpcookieconsent_buttonlearnmore'));
        }
        $link = getOption('zpcookieconsent_buttonlearnmorelink');
        $theme = '';
        if (getOption('zpcookieconsent_theme')) {
            $theme = FULLWEBPATH . '/' . USER_PLUGIN_FOLDER . '/zp_cookieconsent/styles/' . getOption('zpcookieconsent_theme') . '.css';
        }
        $domain = '';
        if (getOption('zpcookieconsent_domain')) {
            $domain = getOption('zpcookieconsent_domain');
        }
        ?>
		<script>
    window.cookieconsent_options = {
				message: '<?php 
        echo js_encode($message);
        ?>
',
				dismiss: '<?php 
        echo js_encode($dismiss);
        ?>
',
        learnMore: '<?php 
        echo $learnmore;
        ?>
',
				theme: '<?php 
        echo $theme;
        ?>
',
        link: '<?php 
        echo html_encode($link);
        ?>
',
				domain: '<?php 
        echo $domain;
        ?>
',
				expiryDays: <?php 
        echo getOption('zpcookieconsent_expirydays');
        ?>
    };
		</script>
		<script src="<?php 
        echo FULLWEBPATH . '/' . USER_PLUGIN_FOLDER;
        ?>
/zp_cookieconsent/cookieconsent.min.js"></script>
		<?php 
    }
예제 #15
0
/**
 * puts out a row in the edit album table
 *
 * @param object $album is the album being emitted
 * @param bool $show_thumb set to false to show thumb standin image rather than album thumb
 *
 **/
function printAlbumEditRow($album, $show_thumb)
{
    $enableEdit = $album->albumSubRights() & MANAGED_OBJECT_RIGHTS_EDIT;
    ?>
	<div class='page-list_row'>

	<div class="page-list_albumthumb">
		<?php 
    if ($show_thumb) {
        $thumbimage = $album->getAlbumThumbImage();
        $thumb = $thumbimage->getCustomImage(40, NULL, NULL, 40, 40, NULL, NULL, -1, NULL);
    } else {
        $thumb = 'images/thumb_standin.png';
    }
    if ($enableEdit) {
        ?>
			<a href="?page=edit&amp;album=<?php 
        echo pathurlencode($album->name);
        ?>
" title="<?php 
        echo sprintf(gettext('Edit this album: %s'), $album->name);
        ?>
">
			<?php 
    }
    ?>
			<img src="<?php 
    echo html_encode($thumb);
    ?>
" width="40" height="40" alt="" title="album thumb" />
		<?php 
    if ($enableEdit) {
        ?>
			</a>
			<?php 
    }
    ?>
	</div>
	<div class="page-list_albumtitle">
	<?php 
    if ($enableEdit) {
        ?>
			<a href="?page=edit&amp;album=<?php 
        echo pathurlencode($album->name);
        ?>
" title="<?php 
        echo sprintf(gettext('Edit this album: %s'), $album->name);
        ?>
">
			<?php 
    }
    echo $album->getTitle();
    if ($enableEdit) {
        ?>
			</a>
			<?php 
    }
    ?>
	</div>
	<?php 
    if ($album->isDynamic()) {
        $imgi = '<img src="images/pictures_dn.png" alt="" title="' . gettext('images') . '" />';
        $imga = '<img src="images/folder_picture_dn.png" alt="" title="' . gettext('albums') . '" />';
    } else {
        $imgi = '<img src="images/pictures.png" alt="" title="' . gettext('images') . '" />';
        $imga = '<img src="images/folder_picture.png" alt="" title="' . gettext('albums') . '" />';
    }
    $ci = count($album->getImages());
    $si = sprintf('%1$s <span>(%2$u)</span>', $imgi, $ci);
    if ($ci > 0 && !$album->isDynamic()) {
        $si = '<a href="?page=edit&amp;album=' . pathurlencode($album->name) . '&amp;tab=imageinfo" title="' . gettext('Subalbum List') . '">' . $si . '</a>';
    }
    $ca = $album->getNumAlbums();
    $sa = sprintf('%1$s <span>(%2$u)</span>', $imga, $ca);
    if ($ca > 0 && !$album->isDynamic()) {
        $sa = '<a href="?page=edit&amp;album=' . pathurlencode($album->name) . '&amp;tab=subalbuminfo" title="' . gettext('Subalbum List') . '">' . $sa . '</a>';
    }
    ?>
	<div class="page-list_extra"><?php 
    echo $sa;
    ?>
</div>
	<div class="page-list_extra"><?php 
    echo $si;
    ?>
</div>
	<?php 
    $wide = '40px';
    ?>
	<div class="page-list_iconwrapperalbum">
		<div class="page-list_icon">
		<?php 
    $pwd = $album->getPassword();
    if (!empty($pwd) && GALLERY_SECURITY != 'private') {
        echo '<a title="' . gettext('Password protected') . '"><img src="images/lock.png" style="border: 0px;" alt="" title="' . gettext('Password protected') . '" /></a>';
    }
    ?>
		</div>
		<div class="page-list_icon">
		<?php 
    if ($album->getShow()) {
        if ($enableEdit) {
            ?>
				<a href="?action=publish&amp;value=0&amp;album=<?php 
            echo pathurlencode($album->name);
            ?>
&amp;XSRFToken=<?php 
            echo getXSRFToken('albumedit');
            ?>
" title="<?php 
            echo sprintf(gettext('Un-publish the album %s'), $album->name);
            ?>
" >
				<?php 
        }
        ?>
				<img src="images/pass.png" style="border: 0px;" alt="" title="<?php 
        echo gettext('Published');
        ?>
" />
			<?php 
        if ($enableEdit) {
            ?>
				</a>
				<?php 
        }
    } else {
        if ($enableEdit) {
            ?>
				<a href="?action=publish&amp;value=1&amp;album=<?php 
            echo pathurlencode($album->name);
            ?>
&amp;XSRFToken=<?php 
            echo getXSRFToken('albumedit');
            ?>
" title="<?php 
            echo sprintf(gettext('Publish the album %s'), $album->name);
            ?>
">
				<?php 
        }
        ?>
				<img src="images/action.png" style="border: 0px;" alt="" title="<?php 
        echo sprintf(gettext('Unpublished'), $album->name);
        ?>
" />
			<?php 
        if ($enableEdit) {
            ?>
				</a>
				<?php 
        }
    }
    ?>
		</div>
		<div class="page-list_icon">
			<?php 
    if ($album->getCommentsAllowed()) {
        if ($enableEdit) {
            ?>
					<a href="?action=comments&amp;commentson=0&amp;album=<?php 
            echo html_encode($album->getFolder());
            ?>
&amp;XSRFToken=<?php 
            echo getXSRFToken('albumedit');
            ?>
" title="<?php 
            echo gettext('Disable comments');
            ?>
">
					<?php 
        }
        ?>
					<img src="images/comments-on.png" alt="" title="<?php 
        echo gettext("Comments on");
        ?>
" style="border: 0px;"/>
				<?php 
        if ($enableEdit) {
            ?>
					</a>
					<?php 
        }
    } else {
        if ($enableEdit) {
            ?>
					<a href="?action=comments&amp;commentson=1&amp;album=<?php 
            echo html_encode($album->getFolder());
            ?>
&amp;XSRFToken=<?php 
            echo getXSRFToken('albumedit');
            ?>
" title="<?php 
            echo gettext('Enable comments');
            ?>
">
					<?php 
        }
        ?>
					<img src="images/comments-off.png" alt="" title="<?php 
        echo gettext("Comments off");
        ?>
" style="border: 0px;"/>
				<?php 
        if ($enableEdit) {
            ?>
					</a>
					<?php 
        }
    }
    ?>
		</div>
		<div class="page-list_icon">
			<a href="<?php 
    echo WEBPATH;
    ?>
/index.php?album=<?php 
    echo pathurlencode($album->name);
    ?>
" title="<?php 
    echo gettext("View album");
    ?>
">
			<img src="images/view.png" style="border: 0px;" alt="" title="<?php 
    echo sprintf(gettext('View album %s'), $album->name);
    ?>
" />
			</a>
		</div>
		<?php 
    if (file_exists(SERVERPATH . '/' . ZENFOLDER . '/' . UTILITIES_FOLDER . '/cache_images.php')) {
        ?>
			<div class="page-list_icon">
				<?php 
        if ($album->isDynamic() || !$enableEdit) {
            ?>
					<img src="images/icon_inactive.png" style="border: 0px;" alt="" title="<?php 
            echo gettext('unavailable');
            ?>
" />
					<?php 
        } else {
            ?>
					<a class="cache" href="<?php 
            echo WEBPATH . '/' . ZENFOLDER . '/' . UTILITIES_FOLDER;
            ?>
/cache_images.php?page=edit&amp;album=<?php 
            echo pathurlencode($album->name);
            ?>
&amp;return=*<?php 
            echo pathurlencode(dirname($album->name));
            ?>
&amp;XSRFToken=<?php 
            echo getXSRFToken('cache_images');
            ?>
" title="<?php 
            echo sprintf(gettext('Pre-cache images in %s'), $album->name);
            ?>
">
					<img src="images/cache1.png" style="border: 0px;" alt="" title="<?php 
            echo sprintf(gettext('Cache the album %s'), $album->name);
            ?>
" />
					</a>
					<?php 
        }
        ?>
			</div>
		<?php 
    }
    ?>
		<div class="page-list_icon">
			<?php 
    if ($album->isDynamic() || !$enableEdit) {
        ?>
				<img src="images/icon_inactive.png" style="border: 0px;" alt="" title="<?php 
        echo gettext('unavailable');
        ?>
" />
				<?php 
    } else {
        ?>
				<a class="warn" href="admin-refresh-metadata.php?page=edit&amp;album=<?php 
        echo pathurlencode($album->name);
        ?>
&amp;return=*<?php 
        echo pathurlencode(dirname($album->name));
        ?>
&amp;XSRFToken=<?php 
        echo getXSRFToken('refresh');
        ?>
" title="<?php 
        echo sprintf(gettext('Refresh metadata for the album %s'), $album->name);
        ?>
">
				<img src="images/refresh1.png" style="border: 0px;" alt="" title="<?php 
        echo sprintf(gettext('Refresh metadata in the album %s'), $album->name);
        ?>
" />
				</a>
				<?php 
    }
    ?>
		</div>
		<div class="page-list_icon">
			<?php 
    if ($album->isDynamic() || !$enableEdit) {
        ?>
				<img src="images/icon_inactive.png" style="border: 0px;" alt="" title="<?php 
        echo gettext('unavailable');
        ?>
" />
				<?php 
    } else {
        ?>
				<a class="reset" href="?action=reset_hitcounters&amp;albumid=<?php 
        echo $album->getAlbumID();
        ?>
&amp;album=<?php 
        echo pathurlencode($album->name);
        ?>
&amp;subalbum=true&amp;XSRFToken=<?php 
        echo getXSRFToken('hitcounter');
        ?>
" title="<?php 
        echo sprintf(gettext('Reset hitcounters for album %s'), $album->name);
        ?>
">
				<img src="images/reset.png" style="border: 0px;" alt="" title="<?php 
        echo sprintf(gettext('Reset hitcounters for the album %s'), $album->name);
        ?>
" />
				</a>
				<?php 
    }
    ?>
		</div>
		<div class="page-list_icon">
			<?php 
    if (!$enableEdit) {
        ?>
				<img src="images/icon_inactive.png" style="border: 0px;" alt="" title="<?php 
        echo gettext('unavailable');
        ?>
" />
				<?php 
    } else {
        ?>
				<a class="delete" href="javascript:confirmDeleteAlbum('?page=edit&amp;action=deletealbum&amp;album=<?php 
        echo urlencode(pathurlencode($album->name));
        ?>
&amp;return=*<?php 
        echo pathurlencode(dirname($album->name));
        ?>
&amp;XSRFToken=<?php 
        echo getXSRFToken('delete');
        ?>
');" title="<?php 
        echo sprintf(gettext("Delete the album %s"), js_encode($album->name));
        ?>
">
				<img src="images/fail.png" style="border: 0px;" alt="" title="<?php 
        echo sprintf(gettext('Delete the album %s'), js_encode($album->name));
        ?>
" />
				</a>
				<?php 
    }
    ?>
		</div>
			<?php 
    if ($enableEdit) {
        ?>
				<div class="page-list_icon">
					<input class="checkbox" type="checkbox" name="ids[]" value="<?php 
        echo $album->getFolder();
        ?>
" onclick="triggerAllBox(this.form, 'ids[]', this.form.allbox);" />
				</div>
				<?php 
    }
    ?>
	</div>
</div>
	<?php 
}
예제 #16
0
            $comment->setComment(sanitize($_POST['comment'], 1));
            $comment->setCustomData($_comment_form_save_post = serialize(getCommentAddress(0)));
            $comment->save();
            header('Location: ' . FULLWEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/comment_form/admin-comments.php?saved&page=editcomment&id=' . $comment->getID());
            exitZP();
    }
}
printAdminHeader('comments');
zp_apply_filter('texteditor_config', 'admin_comments');
?>
<script type="text/javascript">
	//<!-- <![CDATA[
	function confirmAction() {
		if ($('#checkallaction').val() == 'deleteall') {
			return confirm('<?php 
echo js_encode(gettext("Are you sure you want to delete the checked items?"));
?>
');
		} else {
			return true;
		}
	}
	// ]]> -->
</script>
<?php 
echo "\n</head>";
echo "\n<body>";
printLogoAndLinks();
echo "\n" . '<div id="main">';
printTabs();
echo "\n" . '<div id="content">';
/**
 * Prints the list entry of a single category for the sortable list
 *
 * @param array $cat Array storing the db info of the category
 * @param string $flag If the category is protected
 * @return string
 */
function printCategoryListSortableTable($cat, $flag)
{
    global $_zp_zenpage;
    if ($flag) {
        $img = '../../images/drag_handle_flag.png';
    } else {
        $img = '../../images/drag_handle.png';
    }
    $count = count($cat->getArticles(0, false));
    if ($cat->getTitle()) {
        $cattitle = $cat->getTitle();
    } else {
        $cattitle = "<span style='color:red; font-weight: bold'>" . ' *' . $cat->getTitlelink() . "*</span>";
    }
    ?>
	 <div class='page-list_row'>
		<div class='page-list_title' >
		<?php 
    echo "<a href='admin-edit.php?category&amp;titlelink=" . $cat->getTitlelink() . "' title='" . gettext('Edit this category') . "'>" . $cattitle . "</a>" . checkHitcounterDisplay($cat->getHitcounter());
    ?>
		</div>
		<div class="page-list_extra"><?php 
    echo $count;
    ?>
 <?php 
    echo gettext("articles");
    ?>
		</div>
		<div class="page-list_iconwrapper">
			<div class="page-list_icon"><?php 
    $password = $cat->getPassword();
    if (!empty($password) && GALLERY_SECURITY != 'private') {
        echo '<img src="../../images/lock.png" style="border: 0px;" alt="' . gettext('Password protected') . '" title="' . gettext('Password protected') . '" />';
    }
    ?>
			</div>
			<div class="page-list_icon">
			<?php 
    if ($cat->getShow()) {
        $title = gettext("Un-publish");
        ?>
				<a href="?publish=0&amp;titlelink=<?php 
        echo html_encode($cat->getTitlelink());
        ?>
&amp;XSRFToken=<?php 
        echo getXSRFToken('update');
        ?>
" title="<?php 
        echo $title;
        ?>
">
				<img src="../../images/pass.png" alt="<?php 
        gettext("Scheduled for published");
        ?>
" title="<?php 
        echo $title;
        ?>
" /></a>
				<?php 
    } else {
        $title = gettext("Publish");
        ?>
				<a href="?publish=1&amp;titlelink=<?php 
        echo html_encode($cat->getTitlelink());
        ?>
&amp;XSRFToken=<?php 
        echo getXSRFToken('update');
        ?>
" title="<?php 
        echo $title;
        ?>
">
				<img src="../../images/action.png" alt="<?php 
        echo gettext("Un-published");
        ?>
" title="<?php 
        echo $title;
        ?>
" /></a>
				<?php 
    }
    ?>
			</div>
			<div class="page-list_icon">
			<?php 
    if ($count == 0) {
        ?>
				<img src="../../images/icon_inactive.png" alt="<?php 
        gettext('locked');
        ?>
" />
			<?php 
    } else {
        ?>
				<a href="../../../index.php?p=news&amp;category=<?php 
        echo js_encode($cat->getTitlelink());
        ?>
" title="<?php 
        echo gettext("View category");
        ?>
">
				<img src="images/view.png" alt="view" />
				</a>
			<?php 
    }
    ?>
			</div>
			<div class="page-list_icon"><a
					href="?hitcounter=1&amp;id=<?php 
    echo $cat->getID();
    ?>
&amp;tab=categories&amp;XSRFToken=<?php 
    echo getXSRFToken('hitcounter');
    ?>
"
					title="<?php 
    echo gettext("Reset hitcounter");
    ?>
"> <img
					src="../../images/reset.png"
					alt="<?php 
    echo gettext("Reset hitcounter");
    ?>
" /> </a>
			</div>
			<div class="page-list_icon"><a
					href="javascript:confirmDelete('admin-categories.php?delete=<?php 
    echo js_encode($cat->getTitlelink());
    ?>
&amp;tab=categories&amp;XSRFToken=<?php 
    echo getXSRFToken('delete_category');
    ?>
',deleteCategory)"
					title="<?php 
    echo gettext("Delete Category");
    ?>
"><img
					src="../../images/fail.png" alt="<?php 
    echo gettext("Delete");
    ?>
"
					title="<?php 
    echo gettext("Delete Category");
    ?>
" /></a>
			</div>
			<div class="page-list_icon"><input class="checkbox" type="checkbox" name="ids[]" value="<?php 
    echo $cat->getTitlelink();
    ?>
"
					onclick="triggerAllBox(this.form, 'ids[]', this.form.allbox);" />
			</div>
	</div>
</div>
<?php 
}
예제 #18
0
/**
 * Prints all available pages or categories in Zenpage
 *
 * @return string
 */
function printAllNestedList()
{
    global $_zp_zenpage, $host;
    if (isset($_GET['zenpage']) && ($_GET['zenpage'] == "pages" || $_GET['zenpage'] == "categories")) {
        $mode = sanitize($_GET['zenpage']);
        switch ($mode) {
            case 'pages':
                $items = $_zp_zenpage->getPages(false);
                $listtitle = gettext('Pages');
                break;
            case 'categories':
                $items = $_zp_zenpage->getAllCategories(false);
                $listtitle = gettext('Categories');
                break;
        }
        echo "<h3>Zenpage: <em>" . html_encode($listtitle) . "</em> <small> " . gettext("(Click on article title to include a link)") . "</small></h3>";
        echo "<ul class='tinynesteditems'>";
        $indent = 1;
        $open = array(1 => 0);
        $rslt = false;
        foreach ($items as $key => $item) {
            switch ($mode) {
                case 'pages':
                    $obj = new ZenpagePage($item['titlelink']);
                    $itemcontent = truncate_string(getBare($obj->getContent()), 300);
                    $zenpagepage = _PAGES_ . '/' . $item['titlelink'];
                    $unpublished = unpublishedZenpageItemCheck($obj);
                    $counter = '';
                    break;
                case 'categories':
                    $obj = new ZenpageCategory($item['titlelink']);
                    $itemcontent = $obj->getTitle();
                    $zenpagepage = "news/category/" . $item['titlelink'];
                    $unpublished = unpublishedZenpageItemCheck($obj);
                    $counter = ' (' . count($obj->getArticles()) . ') ';
                    break;
            }
            $itemsortorder = $obj->getSortOrder();
            $itemtitlelink = $obj->getTitlelink();
            $itemtitle = $obj->getTitle();
            $itemid = $obj->getID();
            $order = explode('-', $itemsortorder);
            $level = max(1, count($order));
            if ($toodeep = $level > 1 && $order[$level - 1] === '') {
                $rslt = true;
            }
            if ($level > $indent) {
                echo "\n" . str_pad("\t", $indent, "\t") . "<ul>\n";
                $indent++;
                $open[$indent] = 0;
            } else {
                if ($level < $indent) {
                    while ($indent > $level) {
                        $open[$indent]--;
                        $indent--;
                        echo "</li>\n" . str_pad("\t", $indent, "\t") . "</ul>\n";
                    }
                } else {
                    // indent == level
                    if ($open[$indent]) {
                        echo str_pad("\t", $indent, "\t") . "</li>\n";
                        $open[$indent]--;
                    } else {
                        echo "\n";
                    }
                }
            }
            if ($open[$indent]) {
                echo str_pad("\t", $indent, "\t") . "</li>\n";
                $open[$indent]--;
            }
            echo "<li id='" . $itemid . "' class='itemborder'>";
            echo "<a href=\"javascript:ZenpageDialog.insert('','" . $zenpagepage . "','','','" . $itemtitlelink . "','" . js_encode($itemtitle) . "','','','" . $mode . "','','','','');\" title='" . html_encode($itemcontent) . "'>" . html_encode($itemtitle) . $unpublished . $counter . "</a> <small><em>" . $obj->getDatetime() . "</em></small>";
            if ($mode == 'pages') {
                echo " <a href='zoom.php?pages=" . urlencode($itemtitlelink) . "' title='Zoom' class='colorbox' style='outline: none;'><img src='img/magnify.png' alt='' style='border: 0' /></a>";
            }
            $open[$indent]++;
        }
        while ($indent > 1) {
            echo "</li>\n";
            $open[$indent]--;
            $indent--;
            echo str_pad("\t", $indent, "\t") . "</ul>";
        }
        if ($open[$indent]) {
            echo "</li>\n";
        } else {
            echo "\n";
        }
        echo "</ul>\n";
    }
}
예제 #19
0
/**
 * Prints an image or album statistic slideshow using the {@link http://galleria.io/  jQuery plugin Galleria}
 *
 * See readme/documentation for usage:
 * Call directly in a template file or codeblock.
 *
 * NOTE: movie and audio files not supported.
 *
 * @param string $type return statistics of either 'images' or 'albums'
 * @param integer $number the number of items to get (images or albums, depending on $type set)
 * @param string $option
 *  	"popular" for the most popular
 *		"latest" for the latest uploaded by id (Discovery)
 * 		"latest-date" for the latest by date
 * 		"latest-mtime" for the latest by mtime
 *   	"latest-publishdate" for the latest by publishdate
 *      "mostrated" for the most voted
 *		"toprated" for the best voted
 *		"latestupdated" for the latest updated
 *		"random" for random order (yes, strictly no statistical order...)
 * @param string $albumfolder foldername of a specific album to pull items from
 * @param bool $collection only if $albumfolder is set: true if you want to get statistics from this album and all of its subalbums
 * @param bool $linkslides true to link to image or album on slide, else click advances slideshow instead
 * @param mixed $autoplay true to autoplay slideshow with interval set in options, false to start with slideshow stopped.  Set integer in milliseconds to autoplay at that interval (Ex. 4000), overriding plugin option set.
 * @param integer $threshold the minimum number of ratings an image must have to be included in the list. (Default 0)
 *
 */
function printGslideshowStatistic($type, $number, $option, $albumfolder = '', $collection = false, $linkslides = true, $autoplay = true, $threshold = 0)
{
    save_context();
    $data = 'data';
    $embedded = true;
    $forceheight = true;
    $imagenumber = 0;
    $albumtitle = '';
    $returnpath = '';
    require_once SERVERPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/image_album_statistics.php';
    if ($type == 'album' || $type == 'albums') {
        $albums = getAlbumStatistic($number, $option, $albumfolder);
    } else {
        $images = getImageStatistic($number, $option, $albumfolder, $collection, $threshold);
    }
    ?>

			<script>
				var data = [

	<?php 
    if ($type == 'album' || $type == 'albums') {
        $c = 1;
        foreach ($albums as $album) {
            $tempalbum = newAlbum($album['folder']);
            $albumpath = html_encode(rewrite_path("/" . pathurlencode($tempalbum->name), "index.php?album=" . pathurlencode($tempalbum->name)));
            $albumthumb = $tempalbum->getAlbumThumbImage();
            $image = newImage($tempalbum, $albumthumb->filename);
            $ext = isImagePhoto($image);
            if ($ext) {
                makeImageCurrent($image);
                echo '{' . "\n";
                echo 'thumb: \'' . getCustomSizedImageMaxSpace(getOption('gslideshow_thumbsize'), getOption('gslideshow_thumbsize')) . '\',' . "\n";
                echo 'image: \'' . getCustomSizedImageMaxSpace(getOption('gslideshow_mediumsize'), getOption('gslideshow_mediumsize')) . '\',' . "\n";
                echo 'big: \'' . getCustomSizedImageMaxSpace(getOption('gslideshow_bigsize'), getOption('gslideshow_bigsize')) . '\',' . "\n";
                echo 'title: \'' . html_encode($tempalbum->getTitle()) . '\',' . "\n";
                $desc = $tempalbum->getDesc();
                $desc = str_replace("\r\n", '<br />', $desc);
                $desc = str_replace("\r", '<br />', $desc);
                echo 'description: \'' . js_encode($desc) . '\',' . "\n";
                echo 'link: \'' . $albumpath . '\'' . "\n";
                if ($c == $number) {
                    echo '}' . "\n";
                } else {
                    echo '},' . "\n";
                }
            }
            $c++;
        }
        echo "\n";
    } else {
        $c = 1;
        foreach ($images as $image) {
            $ext = isImagePhoto($image);
            if ($ext) {
                makeImageCurrent($image);
                echo '{' . "\n";
                echo 'thumb: \'' . getCustomSizedImageMaxSpace(getOption('gslideshow_thumbsize'), getOption('gslideshow_thumbsize')) . '\',' . "\n";
                echo 'image: \'' . getCustomSizedImageMaxSpace(getOption('gslideshow_mediumsize'), getOption('gslideshow_mediumsize')) . '\',' . "\n";
                echo 'big: \'' . getCustomSizedImageMaxSpace(getOption('gslideshow_bigsize'), getOption('gslideshow_bigsize')) . '\',' . "\n";
                echo 'title: \'' . html_encode($image->getTitle()) . '\',' . "\n";
                $desc = $image->getDesc();
                $desc = str_replace("\r\n", '<br />', $desc);
                $desc = str_replace("\r", '<br />', $desc);
                echo 'description: \'' . js_encode($desc) . '\',' . "\n";
                echo 'link: \'' . html_encode($image->getLink()) . '\'' . "\n";
                if ($c == $number) {
                    echo '}' . "\n";
                } else {
                    echo '},' . "\n";
                }
            }
            $c++;
        }
        echo "\n";
    }
    ?>
				];
			</script>
			<?php 
    printGalleriaRun($data, $linkslides, $autoplay, $embedded, $forceheight, $imagenumber, $albumtitle, $returnpath);
    restore_context();
    // needed if the slideshow is for example called directly via album object before the next_album loop on index.php
}
예제 #20
0
function printBaseSlideShow()
{
    global $_zp_gallery, $_zp_gallery_page, $_myFavorites, $_zp_conf_vars, $_zp_themeroot, $isMobile, $isTablet;
    if (!isset($_POST['albumid'])) {
        return '<div class="errorbox" id="message"><h2>' . gettext('Invalid linking to the slideshow page.') . '</h2></div>';
    }
    //getting the image to start with
    if (!empty($_POST['imagenumber'])) {
        $imagenumber = sanitize_numeric($_POST['imagenumber']) - 1;
        // slideshows starts with 0, but zp with 1.
    } else {
        $imagenumber = 0;
    }
    // set pagenumber to 0 if not called via POST link
    if (isset($_POST['pagenr'])) {
        $pagenumber = sanitize_numeric($_POST['pagenr']);
    } else {
        $pagenumber = 1;
    }
    // getting the number of images
    if (!empty($_POST['numberofimages'])) {
        $numberofimages = sanitize_numeric($_POST['numberofimages']);
    } else {
        $numberofimages = 0;
    }
    //if ($imagenumber < 2 || $imagenumber > $numberofimages) {
    //	$imagenumber = 0;
    //}
    //getting the album to show
    if (!empty($_POST['albumid'])) {
        $albumid = sanitize_numeric($_POST['albumid']);
    } else {
        $albumid = 0;
    }
    if (isset($_POST['preserve_search_params'])) {
        // search page
        $search = new SearchEngine();
        $params = sanitize($_POST['preserve_search_params']);
        $search->setSearchParams($params);
        $searchwords = $search->getSearchWords();
        $searchdate = $search->getSearchDate();
        $searchfields = $search->getSearchFields(true);
        $page = $search->page;
        $returnpath = getSearchURL($searchwords, $searchdate, $searchfields, $page);
        $albumobj = new AlbumBase(NULL, false);
        $albumobj->setTitle(gettext('Search'));
        $albumobj->images = $search->getImages(0);
        $albumtitle = gettext('Search');
    } else {
        if (isset($_POST['favorites_page'])) {
            $albumobj = $_myFavorites;
            $returnpath = rewrite_path($_myFavorites->getLink() . '/' . $pagenumber, FULLWEBPATH . '/index.php?p=favorites' . '&page=' . $pagenumber);
            $albumtitle = gettext('Favorites');
        } else {
            $albumq = query_single_row("SELECT title, folder FROM " . prefix('albums') . " WHERE id = " . $albumid);
            $albumobj = newAlbum($albumq['folder']);
            $albumtitle = $albumobj->getTitle();
            if (empty($_POST['imagenumber'])) {
                $returnpath = $albumobj->getLink($pagenumber);
            } else {
                $image = newImage($albumobj, sanitize($_POST['imagefile']));
                $returnpath = $image->getLink();
            }
        }
    }
    if (!$albumobj->isMyItem(LIST_RIGHTS) && !checkAlbumPassword($albumobj)) {
        return '<div class="errorbox" id="message"><h2>' . gettext('This album is password protected!') . '</h2></div>';
    }
    $slideshow = '';
    $numberofimages = $albumobj->getNumImages();
    if ($numberofimages == 0) {
        return '<div class="errorbox" id="message"><h2>' . gettext('No images for the slideshow!') . '</h2></div>';
    }
    $images = $albumobj->getImages(0);
    // slideshow generate data for galleria
    ?>
		<script>
			var data = [
			<?php 
    for ($c = 0, $idx = 0; $c < $numberofimages; $c++, $idx++) {
        if (is_array($images[$idx])) {
            $filename = $images[$idx]['filename'];
            $album = newAlbum($images[$idx]['folder']);
            $image = newImage($album, $filename);
        } else {
            $filename = $images[$idx];
            $image = newImage($albumobj, $filename);
        }
        if (isImagePhoto($image)) {
            makeImageCurrent($image);
            echo '{' . "\n";
            echo 'thumb: \'' . getImageThumb() . '\',' . "\n";
            echo 'image: \'' . getDefaultSizedImage() . '\',' . "\n";
            echo 'big: \'' . getCustomImageURL(getOption('zpbase_galbigsize')) . '\',' . "\n";
            echo 'title: \'' . js_encode($image->getTitle()) . '\',' . "\n";
            $desc = $image->getDesc();
            $desc = str_replace("\r\n", '<br />', $desc);
            $desc = str_replace("\r", '<br />', $desc);
            echo 'description: \'' . js_encode($desc) . '\',' . "\n";
            if (!getOption('zpbase_nodetailpage')) {
                echo 'link: \'' . html_encode($image->getLink()) . '\'' . "\n";
            }
            if ($c == $numberofimages - 1) {
                echo '}' . "\n";
            } else {
                echo '},' . "\n";
            }
        } else {
            if ($imagenumber > 0 && $imagenumber > $c) {
                $imagenumber--;
            }
        }
    }
    echo "\n";
    ?>
			];
		</script>
		<?php 
    $sspage = true;
    require_once 'inc/galleria-jscall.php';
}
예제 #21
0
파일: topic.php 프로젝트: Kuzat/kofradia
    /**
     * Construct
     */
    public function __construct()
    {
        // endre signatur i forumet
        if (login::$logged_in && (isset($_GET['show_signature']) || isset($_GET['hide_signature']))) {
            if (isset($_GET['show_signature']) && login::$user->data['u_forum_show_signature'] == 0) {
                \Kofradia\DB::get()->exec("UPDATE users SET u_forum_show_signature = 1 WHERE u_id = " . login::$user->id);
            } elseif (isset($_GET['hide_signature']) && login::$user->data['u_forum_show_signature'] == 1) {
                \Kofradia\DB::get()->exec("UPDATE users SET u_forum_show_signature = 0 WHERE u_id = " . login::$user->id);
            }
            redirect::handle(game::address("topic", $_GET, array("show_signature", "hide_signature")));
        }
        // hent forumtråd
        $this->topic = new \Kofradia\Forum\Topic(getval("id"));
        $this->fmod = $this->topic->forum->fmod;
        // sett standard redirect
        redirect::store("topic?id={$this->topic->id}");
        // slette forumtråden?
        if (isset($_POST['delete'])) {
            // forsøk å slette forumtråden
            validate_sid();
            $this->topic->delete();
        }
        // gjenopprette forumtråden?
        if (isset($_POST['restore'])) {
            // forsøk å gjenopprette forumtråden
            validate_sid();
            $this->topic->restore();
        }
        // slette forumsvar?
        if (isset($_GET['delete_reply'])) {
            validate_sid();
            // finn forumsvaret
            if ($reply = $this->topic->get_reply($_GET['delete_reply'])) {
                // forsøk å slett forumsvaret
                $reply->delete();
            } else {
                ess::$b->page->add_message("Fant ikke forumsvaret.", "error");
                redirect::handle();
            }
        }
        // gjenopprette forumsvar?
        if (isset($_GET['restore_reply'])) {
            validate_sid();
            // finn forumsvaret
            if ($reply = $this->topic->get_reply($_GET['restore_reply'])) {
                // forsøk å gjenopprett forumsvaret
                $reply->restore();
            } else {
                ess::$b->page->add_message("Fant ikke forumsvaret.", "error");
                redirect::handle();
            }
        }
        // legge til nytt svar?
        if (isset($_GET['reply']) && isset($_POST['post']) && isset($_POST['text'])) {
            // ikke slå sammen?
            $no_concatenate = isset($_POST['no_concatenate']) && access::has("forum_mod");
            // annonsere?
            $announce = isset($_POST['announce']) && access::has("forum_mod");
            // har vi ingen aktiv spiller?
            if (count(login::$user->lock) == 1 && in_array("player", login::$user->lock)) {
                ess::$b->page->add_message("Du har ingen aktiv spiller.", "error");
                redirect::handle();
            }
            // forsøk å legg til svaret
            $this->topic->add_reply($_POST['text'], $no_concatenate, $announce);
        }
        // den aktuelle siden (sjekk for replyid før vi retter sidetall)
        $pagei = new pagei(pagei::ACTIVE_GET, "p", pagei::PER_PAGE, $this->topic->replies_per_page);
        // sjekk om vi skal vise slettede svar
        if (isset($_GET['show_deleted']) && $this->fmod) {
            $show_deleted = true;
            $deleted = "";
        } else {
            $show_deleted = false;
            $deleted = " AND fr_deleted = 0";
        }
        // skal vi vise status for meldingene?
        $fs_id = 0;
        // skal vi vise et bestemt forumsvar?
        $reply_id = false;
        if (isset($_GET['replyid'])) {
            // hent forumsvaret
            $reply_id = intval($_GET['replyid']);
            $result = \Kofradia\DB::get()->query("SELECT fr_id, fr_deleted FROM forum_replies WHERE fr_ft_id = {$this->topic->id} AND fr_id = {$reply_id}");
            $row = $result->fetch();
            // fant ikke forumsvaret, eller slettet uten tilgang?
            if (!$row || $row['fr_deleted'] != 0 && !$this->fmod) {
                ess::$b->page->add_message("Fant ikke forumsvaret du refererte til.", "error");
                redirect::handle();
            }
            // slettet?
            if ($row['fr_deleted'] != 0 && !$show_deleted) {
                $show_deleted = true;
                $deleted = "";
            }
            // finn ut antall forumsvar før
            $result = \Kofradia\DB::get()->query("SELECT COUNT(fr_id) FROM forum_replies WHERE fr_ft_id = {$this->topic->id} AND fr_id < {$reply_id}{$deleted}");
            $reply_num = $result->fetchColumn(0) + 1;
            // sett opp sidetallet og sett til aktiv side
            $pagei->__construct(pagei::ACTIVE, ceil($reply_num / $this->topic->replies_per_page));
        } elseif (isset($_GET['fs']) && \Kofradia\Forum\Category::$fs_check) {
            // har vi ikke status?
            if (empty($this->topic->info['fs_time'])) {
                // sørg for at vi er på side 1
                if ($pagei->active != 1) {
                    // gå til første side
                    redirect::handle(game::address(PHP_SELF, $_GET, array("p")), redirect::SERVER);
                }
            } else {
                // finn neste forumsvar etter fs_time
                $result = \Kofradia\DB::get()->query("SELECT fr_id FROM forum_replies WHERE fr_ft_id = {$this->topic->id} AND fr_time > {$this->topic->info['fs_time']}{$deleted} ORDER BY fr_time LIMIT 1");
                $row = $result->fetch();
                // fant ikke noe forumsvar?
                if (!$row) {
                    // finn det siste innlegget
                    $result = \Kofradia\DB::get()->query("SELECT fr_id FROM forum_replies WHERE fr_ft_id = {$this->topic->id}{$deleted} ORDER BY fr_time DESC LIMIT 1");
                    $row = $result->fetch();
                }
                // fremdeles ingen forumsvar å gå til?
                if (!$row) {
                    // sørg for at vi er på side 1
                    if ($pagei->active != 1) {
                        // gå til første side
                        redirect::handle(game::address(PHP_SELF, $_GET, array("p")), redirect::SERVER);
                    }
                } else {
                    // finn ut antall forumsvar før det vi skal gå til
                    $result = \Kofradia\DB::get()->query("SELECT COUNT(fr_id) FROM forum_replies WHERE fr_ft_id = {$this->topic->id} AND fr_id < {$row['fr_id']}{$deleted}");
                    $reply_num = $result->fetchColumn(0) + 1;
                    // sett opp sidetallet og kontroller at vi er på riktig side
                    $page = ceil($reply_num / $this->topic->replies_per_page);
                    if ($pagei->active != $page) {
                        // videresend til den riktige siden
                        redirect::handle(game::address(PHP_SELF, $_GET, array("p"), array("p" => $page)), redirect::SERVER);
                    }
                    $fs_id = $row['fr_id'];
                }
            }
        }
        // viser vi slettede meldinger?
        if ($show_deleted) {
            // finn ut hvor mange meldinger som er slettet
            $result = \Kofradia\DB::get()->query("SELECT COUNT(fr_id) FROM forum_replies WHERE fr_ft_id = {$this->topic->id} AND fr_deleted != 0");
            $count = $result->fetchColumn(0);
            ess::$b->page->add_message("Du viser slettede forumsvar. Denne forumtråden har <b>{$count}</b> " . fword("slettet forumsvar", "slettede forumsvar", $count) . ".", NULL, "top");
        }
        // øk visningstelleren hvis vi ikke har besøkt denne forumtråden de siste 10 min
        if (!isset($_SESSION[$GLOBALS['__server']['session_prefix'] . 'forum_topics_visited'][$this->topic->id]) || $_SESSION[$GLOBALS['__server']['session_prefix'] . 'forum_topics_visited'][$this->topic->id] + 600 <= time()) {
            \Kofradia\DB::get()->exec("UPDATE forum_topics SET ft_views = ft_views + 1 WHERE ft_id = {$this->topic->id}");
        }
        // lagre som vist
        $_SESSION[$GLOBALS['__server']['session_prefix'] . 'forum_topics_visited'][$this->topic->id] = time();
        // tittel på siden
        $this->topic->forum->add_title();
        ess::$b->page->add_title($this->topic->info['ft_title']);
        // finn ut antall svar vi har synlige
        if ($show_deleted) {
            $result = \Kofradia\DB::get()->query("SELECT COUNT(fr_id) FROM forum_replies WHERE fr_ft_id = {$this->topic->id}{$deleted}");
            $replies_count = $result->fetchColumn(0);
        } else {
            $replies_count = $this->topic->info['ft_replies'];
        }
        // korriger aktiv side
        $pagei->__construct(pagei::TOTAL, $replies_count);
        // skal vi vise svarskjema?
        $reply_form = login::$logged_in && isset($_GET['reply']) && !$reply_id;
        if ($reply_form) {
            // sørg for at vi er på siste siden
            $pagei->__construct(pagei::ACTIVE_LAST);
        }
        echo '
<div class="bg1_c forumw">
	<h1 class="bg1">' . htmlspecialchars($this->topic->info['ft_title']) . '<span class="left"></span><span class="right"></span></h1>
	<p class="h_left"><a href="forum?id=' . $this->topic->forum->id . '">' . htmlspecialchars($this->topic->forum->get_name()) . '</a></p>
	<p class="h_right">' . ($this->topic->info['ft_locked'] == 1 ? '
		Låst emne!' : '') . (login::$logged_in && $this->topic->info['ft_deleted'] == 0 && ($this->topic->info['ft_locked'] != 1 || $this->fmod) ? '
		<a href="' . htmlspecialchars(game::address(PHP_SELF, $_GET, array("replyid"), array("reply" => true))) . '" class="forum_link_replyform">Opprett svar</a>' : '') . ($this->fmod ? $show_deleted ? '
		<a href="' . htmlspecialchars(game::address(PHP_SELF, $_GET, array("show_deleted", "replyid"))) . '">Skjul slettede svar</a>' : '
		<a href="' . htmlspecialchars(game::address(PHP_SELF, $_GET, array(), array("show_deleted" => true))) . '">Vis slettede svar</a>' : '') . '
	</p>
	<div class="bg1">
<div class="forum" id="forum_topic_container">';
        // vise sidetall øverst?
        if ($pagei->pages > 1) {
            echo '
	<p class="c">' . $pagei->pagenumbers(game::address(PHP_SELF, $_GET, array("p", "replyid", "fs")), game::address(PHP_SELF, $_GET, array("p", "replyid", "fs"), array("p" => "_pageid_"))) . '</p>';
        }
        // hent forumsvar
        $replies = array();
        $up_ids = array();
        $id_list = array();
        $last_time = 0;
        $replies_last_edit = array();
        if ($replies_count > 0) {
            // hent svarene
            $result = \Kofradia\DB::get()->query("\n\t\t\t\tSELECT\n\t\t\t\t\tfr_id, fr_time, fr_up_id, fr_text, fr_deleted, fr_last_edit, fr_last_edit_up_id,\n\t\t\t\t\tup_name, up_access_level, up_forum_signature, up_points, up_profile_image_url,\n\t\t\t\t\tupr_rank_pos,\n\t\t\t\t\tr_time\n\t\t\t\tFROM\n\t\t\t\t\tforum_replies\n\t\t\t\t\tLEFT JOIN users_players ON up_id = fr_up_id\n\t\t\t\t\tLEFT JOIN users_players_rank ON upr_up_id = up_id\n\t\t\t\t\tLEFT JOIN rapportering ON r_type = " . rapportering::TYPE_FORUM_REPLY . " AND r_type_id = fr_id AND r_state < 2\n\t\t\t\tWHERE fr_ft_id = {$this->topic->id}{$deleted}\n\t\t\t\tGROUP BY fr_id\n\t\t\t\tORDER BY fr_time ASC\n\t\t\t\tLIMIT {$pagei->start}, {$pagei->per_page}");
            while ($row = $result->fetch()) {
                $id_list[] = $row['fr_id'];
                $up_ids[] = $row['fr_up_id'];
                $last_time = $row['fr_time'];
                $replies_last_edit[$row['fr_id']] = $row['fr_last_edit'];
                $replies[] = $row;
            }
        }
        // hent inn familierelasjoner
        $up_ids[] = $this->topic->info['ft_up_id'];
        $this->topic->forum->ff_get_familier($up_ids);
        // vis hovedinnlegget
        echo $this->topic->forum->template_topic($this->topic->extended_info());
        // vis forumsvar
        if (count($replies) > 0) {
            // scrolle til første forumsvar på andre enn første side
            if ($pagei->active > 1 && !$reply_form && !$reply_id && !$fs_id) {
                echo '
	<div id="forum_scroll_here"></div>';
            }
            $reply_num = $pagei->per_page * ($pagei->active - 1) + 1;
            foreach ($replies as $row) {
                $row['ft_fse_id'] = $this->topic->forum->id;
                $row['ft_id'] = $this->topic->id;
                $row['reply_num'] = ++$reply_num;
                $row['fs_new'] = \Kofradia\Forum\Category::$fs_check && $this->topic->info['fs_time'] < $row['fr_time'];
                if ($reply_id == $row['fr_id']) {
                    $row['class_extra'] = 'forum_focus';
                }
                if ($reply_id == $row['fr_id'] || $fs_id == $row['fr_id']) {
                    $row['h2_extra'] = 'id="forum_scroll_here"';
                    // vis bokser her
                    if ($reply_id == $row['fr_id'] || $fs_id == $row['fr_id']) {
                        echo '
	<boxes />';
                    }
                }
                // vis html for svaret
                echo $this->topic->forum->template_topic_reply($row);
            }
        }
        // oppdatere sist sett?
        $time = $last_time != 0 ? $last_time : $this->topic->info['ft_time'];
        // legge til?
        if (login::$logged_in && empty($this->topic->info['fs_time'])) {
            \Kofradia\DB::get()->exec("INSERT IGNORE INTO forum_seen SET fs_ft_id = {$this->topic->id}, fs_u_id = " . login::$user->id . ", fs_time = {$time}");
        } elseif (login::$logged_in && $time > $this->topic->info['fs_time']) {
            \Kofradia\DB::get()->exec("UPDATE forum_seen SET fs_time = GREATEST(fs_time, {$time}) WHERE fs_ft_id = {$this->topic->id} AND fs_u_id = " . login::$user->id);
        }
        echo '
</div>';
        // vis svarskjema
        echo '
<div' . ($reply_form ? '' : ' style="display: none"') . ' id="container_reply">' . ($reply_form ? '
	<boxes />' : '') . '
	<form action="' . htmlspecialchars(game::address("topic", $_GET, array("replyid", "fs"), array("reply" => true))) . '" method="post"' . ($reply_form ? ' id="forum_scroll_here"' : '') . '>
		<div class="section forum_reply_edit_c">
			<h2>Svar</h2>
			<dl class="dl_2x">
				<dt>Innhold</dt>
				<dd><textarea name="text" rows="20" cols="75" id="replyText">' . htmlspecialchars(postval("text")) . '</textarea></dd>';
        // vise ekstra alternativer?
        if (access::has("forum_mod") || $this->topic->forum->id >= 5 && $this->topic->forum->id <= 7) {
            $no_concat = isset($_POST['no_concatenate']) || $_SERVER['REQUEST_METHOD'] != "POST" && $this->topic->forum->id >= 5 && $this->topic->forum->id <= 7;
            $announce_text = $this->topic->forum->id >= 5 && $this->topic->forum->id <= 7 ? 'Legg til logg i spilleloggen til medlemmer av Crewet.' : 'Annonser på #kofradia kanalen';
            echo '
				<dt>Ekstra</dt>
				<dd>' . (!$this->topic->forum->ff ? '
					<input type="checkbox" name="announce" id="announce"' . (isset($_POST['announce']) ? ' checked="checked"' : '') . ' /><label for="announce"> ' . $announce_text . '</label><br />' : '') . '
					<input type="checkbox" name="no_concatenate" id="no_concatenate"' . ($no_concat ? ' checked="checked"' : '') . ' /><label for="no_concatenate"> <u>Ikke</u> kombiner sammen med siste melding.</label>
				</dd>';
        }
        echo '
			</dl>
			<p class="c">
				' . show_sbutton("Legg til svar", 'name="post" accesskey="s" id="forum_reply_button_add"') . '
				' . show_sbutton("Forhåndsvis", 'name="preview" accesskey="p" id="forum_reply_button_preview"') . '
			</p>
		</div>
		<div id="reply_preview" class="forum">';
        // forhåndsvise?
        if (login::$logged_in && isset($_POST['preview'])) {
            $data = array("ft_id" => $this->topic->id, "fr_text" => postval("text"), "fr_up_id" => login::$user->player->id, "up_name" => login::$user->player->data['up_name'], "up_access_level" => login::$user->player->data['up_access_level'], "up_points" => login::$user->player->data['up_points'], "upr_rank_pos" => login::$user->player->data['upr_rank_pos'], "up_forum_signature" => login::$user->player->data['up_forum_signature'], "up_profile_image_url" => login::$user->player->data['up_profile_image_url'], "fs_new" => \Kofradia\Forum\Category::$fs_check);
            echo \Kofradia\Forum\Category::template_topic_reply_preview($data);
        }
        echo '</div>
	</form>
</div>';
        // linker i bunn
        if (login::$logged_in) {
            echo '
<form action="" method="post">
	<input type="hidden" name="sid" value="' . login::$info['ses_id'] . '" />
	<div class="forum_footer_links">';
            // slette/gjenopprette lenker
            if ($this->fmod || $this->topic->info['ft_up_id'] == login::$user->player->id) {
                echo '
		<p class="left">' . ($this->topic->info['ft_deleted'] == 0 ? '
			<span class="red">' . show_sbutton("Slett emnet", 'name="delete" onclick="return confirm(\'Sikker?!\')"') . '</span>' : '
			<span class="green">' . show_sbutton("Gjenopprett emnet", 'name="restore" onclick="return confirm(\'Sikker?!\')"') . '</span>') . '
		</p>';
            }
            // alternativer
            echo '
		<p class="right">';
            // reply lenke
            if (!$reply_form && $this->topic->info['ft_deleted'] == 0 && ($this->topic->info['ft_locked'] == 0 || $this->fmod)) {
                echo '
			<a href="' . htmlspecialchars(game::address("topic", $_GET, array("replyid"), array("reply" => true))) . '" class="button forum_link_replyform" accesskey="r">Opprett svar</a>';
            }
            // signatur lenker
            echo login::$user->data['u_forum_show_signature'] == 1 ? '
			<a href="' . htmlspecialchars(game::address("topic", $_GET, array("show_signature"), array("hide_signature" => true))) . '" class="button">Skjul signaturer</a>' : '
			<a href="' . htmlspecialchars(game::address("topic", $_GET, array("hide_signature"), array("show_signature" => true))) . '" class="button">Vis signaturer</a>';
            echo '
		</p>';
        }
        // sidetall
        if ($pagei->pages > 1) {
            echo '
		<p class="center">' . $pagei->pagenumbers(game::address(PHP_SELF, $_GET, array("p", "replyid", "fs", "reply")), game::address(PHP_SELF, $_GET, array("p", "replyid", "fs", "reply"), array("p" => "_pageid_"))) . '</p>';
        }
        echo '
	</div>
</form>
	</div>
</div>';
        // div javascript
        // sørg for at meldingene blir oppdatert og at nye meldinger blr hentet hvis vi er på siste side
        ess::$b->page->add_js_file(ess::$s['relative_path'] . "/js/forum.js");
        ess::$b->page->add_js('
		sm_scripts.report_links();');
        ess::$b->page->add_js_domready('
	var topic = new ForumTopic(' . $this->topic->id . ', ' . js_encode($id_list) . ', ' . js_encode($replies_last_edit) . ', ' . ($pagei->pages == $pagei->active ? 'true' : 'false') . ', ' . ($show_deleted ? 'true' : 'false') . ', ' . ($this->fmod ? 'true' : 'false') . ', ' . (int) $this->topic->info['ft_last_edit'] . ');' . ($reply_form ? '
	topic.reply_form_show();' : ''));
        $this->topic->forum->load_page();
    }
예제 #22
0
    }
    while (next_image(true)) {
        if (isImagePhoto($_zp_current_image)) {
            if ($c == 0) {
                echo '{' . "\n";
            } else {
                echo ',{' . "\n";
            }
            echo 'thumb: \'' . getImageThumb() . '\',' . "\n";
            echo 'image: \'' . getDefaultSizedImage() . '\',' . "\n";
            echo 'big: \'' . getCustomImageURL(getOption('zpbase_galbigsize')) . '\',' . "\n";
            echo 'title: \'' . html_encode(getBareImageTitle()) . '\',' . "\n";
            $desc = getBareImageDesc();
            $desc = str_replace("\r\n", '<br />', $desc);
            $desc = str_replace("\r", '<br />', $desc);
            echo 'description: \'' . js_encode($desc) . '\',' . "\n";
            if (!getOption('zpbase_nodetailpage')) {
                echo 'link: \'' . html_encode(getImageURL()) . '\'' . "\n";
            }
            echo '}' . "\n";
            $c++;
        }
    }
    ?>
					];
				</script>
				<?php 
    if ($c > 0) {
        ?>
				<div id="galleria"></div>
				<?php 
예제 #23
0
    static function printSlideShow($heading = true, $speedctl = false, $albumobj = "", $imageobj = "", $width = "", $height = "")
    {
        if (!isset($_POST['albumid']) and !is_object($albumobj)) {
            echo "<div class=\"errorbox\" id=\"message\"><h2>" . gettext("Invalid linking to the slideshow page.") . "</h2></div>";
            echo "</div></body></html>";
            exit;
        }
        global $_zp_flash_player, $_zp_current_image, $_zp_current_album, $_zp_gallery;
        //getting the image to start with
        if (!empty($_POST['imagenumber']) and !is_object($imageobj)) {
            $imagenumber = $_POST['imagenumber'] - 1;
            // slideshows starts with 0, but zp with 1.
        } elseif (is_object($imageobj)) {
            makeImageCurrent($imageobj);
            $imagenumber = imageNumber() - 1;
        } else {
            $imagenumber = 0;
        }
        // set pagenumber to 0 if not called via POST link
        if (isset($_POST['pagenr'])) {
            $pagenumber = sanitize_numeric($_POST['pagenr']);
        } else {
            $pagenumber = 0;
        }
        // getting the number of images
        if (!empty($_POST['numberofimages'])) {
            $numberofimages = sanitize_numeric($_POST['numberofimages']);
        } elseif (is_object($albumobj)) {
            $numberofimages = $albumobj->getNumImages();
        }
        //getting the album to show
        if (!empty($_POST['albumid']) and !is_object($albumobj)) {
            $albumid = sanitize_numeric($_POST['albumid']);
        } elseif (is_object($albumobj)) {
            $albumid = $albumobj->id;
        } else {
            $albumid = -1;
        }
        // setting the image size
        if (!empty($width) and !empty($height)) {
            $width = sanitize_numeric($width);
            $height = sanitize_numeric($height);
        } else {
            $width = getOption("slideshow_width");
            $height = getOption("slideshow_height");
        }
        $option = getOption("slideshow_mode");
        // jQuery Cycle slideshow config
        // get slideshow data
        $gallery = new Gallery();
        if ($albumid <= 0) {
            // search page
            $dynamic = 2;
            $search = new SearchEngine();
            $params = $_POST['preserve_search_params'];
            $search->setSearchParams($params);
            $images = $search->getImages(0);
            $searchwords = $search->words;
            $searchdate = $search->dates;
            $searchfields = $search->fields;
            $page = $search->page;
            if (empty($_POST['imagenumber'])) {
                $albumq = query_single_row("SELECT title, folder FROM " . prefix('albums') . " WHERE id = " . abs($albumid));
                $album = new Album($gallery, $albumq['folder']);
                $returnpath = getSearchURL($searchwords, $searchdate, $searchfields, $page);
                //$returnpath = rewrite_path('/'.pathurlencode($album->name).'/page/'.$pagenumber,'/index.php?album='.urlencode($album->name).'&page='.$pagenumber);
            } else {
                $returnpath = getSearchURL($searchwords, $searchdate, $searchfields, $page);
            }
            $albumtitle = gettext('Search');
        } else {
            $albumq = query_single_row("SELECT title, folder FROM " . prefix('albums') . " WHERE id = " . $albumid);
            $album = new Album($gallery, $albumq['folder']);
            $albumtitle = $album->getTitle();
            if (!checkAlbumPassword($albumq['folder'], $hint)) {
                echo gettext("This album is password protected!");
                exit;
            }
            $dynamic = $album->isDynamic();
            $images = $album->getImages(0);
            // return path to get back to the page we called the slideshow from
            if (empty($_POST['imagenumber'])) {
                $returnpath = rewrite_path('/' . pathurlencode($album->name) . '/page/' . $pagenumber, '/index.php?album=' . urlencode($album->name) . '&page=' . $pagenumber);
            } else {
                $returnpath = rewrite_path('/' . pathurlencode($album->name) . '/' . rawurlencode($_POST['imagefile']) . getOption('mod_rewrite_image_suffix'), '/index.php?album=' . urlencode($album->name) . '&image=' . urlencode($_POST['imagefile']));
            }
        }
        // slideshow display section
        switch ($option) {
            case "jQuery":
                $validtypes = array('jpg', 'jpeg', 'gif', 'png', 'mov', '3gp');
                ?>
					<script type="text/javascript">
						$(document).ready(function(){
							$(function() {
								var ThisGallery = '<?php 
                echo html_encode($albumtitle);
                ?>
';
								var ImageList = new Array();
								var TitleList = new Array();
								var DescList = new Array();
								var ImageNameList = new Array();
								var DynTime=(<?php 
                echo getOption("slideshow_timeout");
                ?>
) * 1.0;	// force numeric
								<?php 
                for ($imgnr = 0, $cntr = 0, $idx = $imagenumber; $imgnr < $numberofimages; $imgnr++, $idx++) {
                    if ($dynamic) {
                        $filename = $images[$idx]['filename'];
                        $album = new Album($gallery, $images[$idx]['folder']);
                        $image = newImage($album, $filename);
                    } else {
                        $filename = $images[$idx];
                        $image = newImage($album, $filename);
                    }
                    $ext = is_valid($filename, $validtypes);
                    if ($ext) {
                        makeImageCurrent($image);
                        $img = getCustomSizedImageMaxSpace($width, $height);
                        //$img = WEBPATH . '/' . ZENFOLDER . '/i.php?a=' . pathurlencode($image->album->name) . '&i=' . urlencode($filename) . '&s=' . $imagesize;
                        echo 'ImageList[' . $cntr . '] = "' . $img . '";' . "\n";
                        echo 'TitleList[' . $cntr . '] = "' . js_encode($image->getTitle()) . '";' . "\n";
                        if (getOption("slideshow_showdesc")) {
                            $desc = $image->getDesc();
                            $desc = str_replace("\r\n", '<br />', $desc);
                            $desc = str_replace("\r", '<br />', $desc);
                            echo 'DescList[' . $cntr . '] = "' . js_encode($desc) . '";' . "\n";
                        } else {
                            echo 'DescList[' . $cntr . '] = "";' . "\n";
                        }
                        if ($idx == $numberofimages - 1) {
                            $idx = -1;
                        }
                        echo 'ImageNameList[' . $cntr . '] = "' . urlencode($filename) . '";' . "\n";
                        $cntr++;
                    }
                }
                echo "\n";
                $numberofimages = $cntr;
                ?>
								var countOffset = <?php 
                echo $imagenumber;
                ?>
;
								var totalSlideCount = <?php 
                echo $numberofimages;
                ?>
;
								var currentslide = 2;
			
								function onBefore(curr, next, opts) {
									//$(next).parent().animate({opacity: 0});

									if (opts.timeout != DynTime) {
										opts.timeout = DynTime;
									}
									if (!opts.addSlide)
										return;
							
									var currentImageNum = currentslide;
									currentslide++;
									if (currentImageNum == totalSlideCount) {
										opts.addSlide = null;
										return;
									}
									var relativeSlot = (currentslide + countOffset) % totalSlideCount;
									if (relativeSlot == 0) {relativeSlot = totalSlideCount;}
									var htmlblock = "<span class='slideimage'><h4><strong>" + ThisGallery + ":</strong> ";
									htmlblock += TitleList[currentImageNum]  + " (" + relativeSlot + "/" + totalSlideCount + ")</h4>";
									htmlblock += "<img src='" + ImageList[currentImageNum] + "'/>";
									htmlblock += "<p class='imgdesc'>" + DescList[currentImageNum] + "</p></span>";
									opts.addSlide(htmlblock);

								}
			
								function onAfter(curr, next, opts){
									<?php 
                if (!isMyALbum($album->name, ALL_RIGHTS)) {
                    ?>
									//Only register at hit count the first time the image is viewed.
									if ($(next).attr( 'viewed') != 1) {
										$.get("<?php 
                    echo FULLWEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER;
                    ?>
/slideshow/slideshow-counter.php?album=<?php 
                    echo pathurlencode($album->name);
                    ?>
&img="+ImageNameList[opts.currSlide]);
										$(next).attr( 'viewed', 1 );
									}
									<?php 
                }
                ?>

									//THE MISSING LINE
									$(next).parent().height(
										$(next).find('img').height() + $(next).find('p').height() + $(next).find('h4').height() + 40
									); //.animate({opacity: 1}, 'normal', 'linear');
									//getOption('slideshow_onafter'); //make it generic
									//END MISSING LINE
								}
			
								$('#slides').cycle({
										fx:     '<?php 
                echo getOption("slideshow_effect");
                ?>
',
										speed:   <?php 
                echo getOption("slideshow_speed");
                ?>
,
										timeout: DynTime,
										next:   '#next',
										prev:   '#prev',
										cleartype: 1,
										before: onBefore,
										after: onAfter
								});
			
								$('#speed').change(function () {
									DynTime = this.value;
									return false;
								});
			
								$('#pause').click(function() { $('#slides').cycle('pause'); return false; });
								$('#play').click(function() { $('#slides').cycle('resume'); return false; });
							});
			
						});	// Documentready()
			
						</script>
						<div id="slideshow" align="center">
						<?php 
                // 7/21/08dp
                if ($speedctl) {
                    echo '<div id="speedcontrol">';
                    // just to keep it away from controls for sake of this demo
                    $minto = getOption("slideshow_speed");
                    while ($minto % 500 != 0) {
                        $minto += 100;
                        if ($minto > 10000) {
                            break;
                        }
                        // emergency bailout!
                    }
                    $dflttimeout = getOption("slideshow_timeout");
                    /* don't let min timeout = speed */
                    $thistimeout = $minto == getOption("slideshow_speed") ? $minto + 250 : $minto;
                    echo 'Select Speed: <select id="speed" name="speed">';
                    while ($thistimeout <= 60000) {
                        // "around" 1 minute :)
                        echo "<option value={$thistimeout} " . ($thistimeout == $dflttimeout ? " selected='selected'>" : ">") . round($thistimeout / 1000, 1) . " sec</option>";
                        /* put back timeout to even increments of .5 */
                        if ($thistimeout % 500 != 0) {
                            $thistimeout -= 250;
                        }
                        $thistimeout += $thistimeout < 1000 ? 500 : ($thistimeout < 10000 ? 1000 : 5000);
                    }
                    echo "</select> </div>";
                }
                if (!is_object($albumobj)) {
                    // disable controls if calling the slideshow directly on homepage for example
                    ?>
						<div id="controls">
						<div><span><a href="#" id="prev"
							title="<?php 
                    echo gettext("Previous");
                    ?>
"></a></span> <a
							href="<?php 
                    echo $returnpath;
                    ?>
" id="stop"
							title="<?php 
                    echo gettext("Stop and return to album or image page");
                    ?>
"></a>
						<a href="#" id="pause"
							title="<?php 
                    echo gettext("Pause (to stop the slideshow without returning)");
                    ?>
"></a>
						<a href="#" id="play" title="<?php 
                    echo gettext("Play");
                    ?>
"></a> <a
							href="#" id="next" title="<?php 
                    echo gettext("Next");
                    ?>
"></a>
						</div>
						</div>
						<?php 
                }
                ?>
						<div id="slides" class="pics">
						<?php 
                if ($cntr > 1) {
                    $cntr = 1;
                }
                for ($imgnr = 0, $idx = $imagenumber; $imgnr <= $cntr; $idx++) {
                    if ($idx >= $numberofimages) {
                        $idx = 0;
                    }
                    if ($dynamic) {
                        $folder = $images[$idx]['folder'];
                        $dalbum = new Album($gallery, $folder);
                        $filename = $images[$idx]['filename'];
                        $image = newImage($dalbum, $filename);
                        $imagepath = FULLWEBPATH . getAlbumFolder('') . pathurlencode($folder) . "/" . urlencode($filename);
                    } else {
                        $folder = $album->name;
                        $filename = $images[$idx];
                        //$filename = $animage;
                        $image = newImage($album, $filename);
                        $imagepath = FULLWEBPATH . getAlbumFolder('') . pathurlencode($folder) . "/" . urlencode($filename);
                    }
                    $ext = is_valid($filename, $validtypes);
                    if ($ext) {
                        $imgnr++;
                        echo "<span class='slideimage'><h4><strong>" . $albumtitle . gettext(":") . "</strong> " . $image->getTitle() . " (" . ($idx + 1) . "/" . $numberofimages . ")</h4>";
                        if ($ext == "3gp") {
                            echo '</a>
												<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="352" height="304" codebase="http://www.apple.com/qtactivex/qtplugin.cab">
												<param name="src" value="' . $imagepath . '"/>
												<param name="autoplay" value="false" />
												<param name="type" value="video/quicktime" />
												<param name="controller" value="true" />
												<embed src="' . $imagepath . '" width="352" height="304" autoplay="false" controller"true" type="video/quicktime"
												pluginspage="http://www.apple.com/quicktime/download/" cache="true"></embed>
												</object>
												<a>';
                        } elseif ($ext == "mov") {
                            echo '</a>
									 			<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="640" height="496" codebase="http://www.apple.com/qtactivex/qtplugin.cab">
										 		<param name="src" value="' . $imagepath . '"/>
										 		<param name="autoplay" value="false" />
										 		<param name="type" value="video/quicktime" />
										 		<param name="controller" value="true" />
										 		<embed src="' . $imagepath . '" width="640" height="496" autoplay="false" controller"true" type="video/quicktime"
										 		pluginspage="http://www.apple.com/quicktime/download/" cache="true"></embed>
												</object>
												<a>';
                        } else {
                            makeImageCurrent($image);
                            printCustomSizedImageMaxSpace($alt = '', $width, $height, NULL, NULL, false);
                            //echo "<img src='".WEBPATH."/".ZENFOLDER."/i.php?a=".urlencode($folder)."&i=".urlencode($filename)."&s=".$imagesize."' alt='".html_encode($image->getTitle())."' title='".html_encode($image->getTitle())."' />\n";
                        }
                        if (getOption("slideshow_showdesc")) {
                            $desc = $image->getDesc();
                            $desc = str_replace("\r\n", '<br />', $desc);
                            $desc = str_replace("\r", '<br />', $desc);
                            echo "<p class='imgdesc'>" . $desc . "</p>";
                        }
                        echo "</span>";
                    }
                }
                break;
            case "flash":
                if ($heading) {
                    echo "<span class='slideimage'><h4><strong>" . $albumtitle . "</strong> (" . $numberofimages . " images) | <a style='color: white' href='" . $returnpath . "' title='" . gettext("back") . "'>" . gettext("back") . "</a></h4>";
                }
                echo "<span id='slideshow'></span>";
                ?>
 
					<script type="text/javascript">
					$("#slideshow").flashembed({
						  src:'<?php 
                echo FULLWEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER;
                ?>
/flowplayer/FlowPlayerLight.swf',
						  width:<?php 
                echo getOption("slideshow_flow_player_width");
                ?>
,
						  height:<?php 
                echo getOption("slideshow_flow_player_height");
                ?>
						},
						{config: {
						  autoPlay: true,
						  useNativeFullScreen: true,
						  playList: [
													<?php 
                echo "\n";
                $count = 0;
                foreach ($images as $animage) {
                    if ($dynamic) {
                        $folder = $animage['folder'];
                        $filename = $animage['filename'];
                        $salbum = new Album($_zp_gallery, $folder);
                        $image = newImage($salbum, $filename);
                        $imagepath = FULLWEBPATH . getAlbumFolder('') . pathurlencode($salbum->name) . "/" . urlencode($filename);
                    } else {
                        $folder = $album->name;
                        $filename = $animage;
                        $image = newImage($album, $filename);
                        $imagepath = FULLWEBPATH . getAlbumFolder('') . pathurlencode($folder) . "/" . pathurlencode($filename);
                    }
                    $ext = is_valid($filename, array('jpg', 'jpeg', 'gif', 'png', 'flv', 'mp3', 'mp4'));
                    if ($ext) {
                        if ($ext == "flv" || $ext == "mp3" || $ext == "mp4") {
                            $duration = "";
                        } else {
                            $duration = ", duration: " . getOption("slideshow_speed") / 10;
                        }
                        if ($count > 0) {
                            echo ",\n";
                        }
                        echo "{ url: '" . FULLWEBPATH . getAlbumFolder('') . pathurlencode($folder) . "/" . urlencode($filename) . "'" . $duration . " }";
                        $count++;
                    }
                }
                echo "\n";
                ?>
												],
						  showPlayListButtons: true,
						  showStopButton: true,
						  controlBarBackgroundColor: 0,
						 	showPlayListButtons: true,
						 	controlsOverVideo: 'ease',
						 	controlBarBackgroundColor: '<?php 
                echo getOption('flow_player_controlbarbackgroundcolor');
                ?>
',
						  controlsAreaBorderColor: '<?php 
                echo getOption('flow_player_controlsareabordercolor');
                ?>
'
						}}
				  );
					</script> 
					<?php 
                echo "</span>";
                echo "<p>";
                printf(gettext("Click on %s on the right in the player control bar to view full size."), "<img style='position: relative; top: 4px; border: 1px solid gray' src='" . WEBPATH . "/" . ZENFOLDER . '/' . PLUGIN_FOLDER . "/slideshow/flowplayerfullsizeicon.png' />");
                echo "</p>";
                break;
        }
        ?>
			</div>
		</div>
			<?php 
    }
예제 #24
0
        $type .= "720";
    } elseif (preg_match("/\\/(DVDR-U?KOMP|Filmer-DVDR|dvdr)\\//i", $film->path)) {
        $type .= "DVDR";
    }
    $js_data[$film->path_id] = array("plot" => "test", "genres" => $genres, "codec" => $codec, "res" => $res, "width" => $res ? $data['video'][0]['width'] : false, "height" => $res ? $data['video'][0]['height'] : false, "norsub" => $norsub, "sub" => $sub, "imdb_id" => $film->get_imdb_id(), "title" => $film->get("title"), "aka" => $film->get("aka"), "year" => $film->get("year"), "rating" => $film->get("rating"), "has_poster" => $film->has_poster(), "runtime" => $film->get("runtime"), "keywords" => $keywords, "actors" => $actors_id, "type" => $type);
    $plots[$film->path_id] = $film->get("plot");
    #if ($i++ == 10) break;
}
sort($js_genres);
asort($js_actors);
$template->js .= '
$(function() {
	filmdata.data = ' . js_encode($js_data) . ';
	filmdata.genres = ' . js_encode($js_genres) . ';
	filmdata.genres_count = ' . js_encode($js_genres_count) . ';
	filmdata.actors = ' . js_encode($js_actors) . ';
	filmdata.init();

	// FIXME new OverText(document.id("dur_from"));
	// FIXME new OverText(document.id("dur_to"));
});';
$template->css .= '
';
$ret = '
<h1>Filmdatabase <i style="font-size: 70%; font-weight: normal">av <a href="http://henrist.net/">Henrik</a></i></h1>
<p>Denne siden er en indeksert oversikt over alle filmene jeg har, og hvor det er mulig å søke og filtrere ut listen for å finne en passende film å se. Det er et delvis uferdig produkt, og det hender jeg tar noen timer når jeg er ledig og oppdaterer med litt ny funksjonalitet. Oversikten er generert med data fra IMDB.</p>
<p><a href="?manage">Behandle liste og indekser filmer &raquo;</a></p>

<fieldset class="hide" id="filterarea">
	<legend>Filtrering</legend>
	<p>
예제 #25
0
    protected function js()
    {
        // mottakere
        $list = array();
        foreach ($this->receivers as $row) {
            $list[] = array($row['up_id'], $row['up_name'], game::profile_link($row['up_id'], $row['up_name'], $row['up_access_level']));
        }
        // hent javascript filen til innboksen
        ess::$b->page->add_js_file(ess::$s['relative_path'] . "/js/innboks.js");
        // javascript
        ess::$b->page->add_js_domready('
	innboks_ny.receivers = ' . js_encode($list) . ';
	innboks_ny.limit = ' . $this->receivers_limit . ';
	innboks_ny.init();');
    }
예제 #26
0
											</td>
											<?php 
        }
        ?>
										<td class="page-list_icon">
											<a href="javascript:confirmDelete('admin-news.php<?php 
        echo $option . $divider;
        ?>
delete=<?php 
        echo $article->getTitlelink();
        ?>
&amp;XSRFToken=<?php 
        echo getXSRFToken('delete');
        ?>
','<?php 
        echo js_encode(gettext('Are you sure you want to delete this article? THIS CANNOT BE UNDONE!'));
        ?>
')" title="<?php 
        echo gettext('Delete article');
        ?>
">
												<img src="<?php 
        echo WEBPATH . '/' . ZENFOLDER;
        ?>
/images/fail.png" alt="" title="<?php 
        echo gettext('Delete article');
        ?>
" /></a>
										</td>
										<td class="page-list_icon">
											<input type="checkbox" name="ids[]" value="<?php 
예제 #27
0
파일: tidy.php 프로젝트: pheski/Scribite
        // Tidy on the local machine failed, try a post
        $res_1 = PostIt(array('_function' => 'tidy', '_html' => $_REQUEST['content'], 'char-encoding' => 'utf8', '_output' => 'warn', 'indent' => 'auto', 'wrap' => 9999, 'break-before-br' => 'y', 'bare' => 'n', 'word-2000' => 'n', 'drop-empty-paras' => 'y', 'drop-font-tags' => 'n'), 'http://infohound.net/tidy/tidy.pl');
        if (preg_match('/<a href="([^"]+)" title="Save the tidied HTML/', $res_1, $m)) {
            $tgt = strtr($m[1], array_flip(get_html_translation_table(HTML_ENTITIES)));
            $content = implode('', file('http://infohound.net/tidy/' . $tgt));
        }
    }
    if (strlen($content) && !preg_match('/<\\/body>/i', $_REQUEST['content'])) {
        if (preg_match('/<body[^>]*>(.*)<\\/body>/is', $content, $matches)) {
            $content = $matches[1];
        }
    } elseif (!strlen($content)) {
        $content = $_REQUEST['content'];
    }
    if ($content) {
        ?>
      {action:'setHTML',value:'<?php 
        echo js_encode($content);
        ?>
'};
      <?php 
    } else {
        ?>
      {action:'alert',value:'Tidy failed.  Check your HTML for syntax errors.'};
      <?php 
    }
} else {
    ?>
    {action:'alert',value:"You don't have anything to tidy!"}
    <?php 
}
예제 #28
0
파일: index.php 프로젝트: amjadtbssm/xcc
function echo_games($results, $pid, $cid, $unfair_games)
{
    global $tables;
    printf("tr1f(%d);", $cid);
    if ($result = mysql_fetch_assoc($results)) {
        do {
            $players_result = db_query(sprintf("\n\t\t\t\t\tselect t1.*, t2.*, t4.rank, t5.rank crank, t3.name cname, t3.win_count cwin_count, t3.loss_count closs_count, t3.points cpoints\n\t\t\t\t\tfrom %s t1 inner join %s t2 using (pid) left join %s t4 using (pid) left join %s t3 on (t1.cid = t3.pid) left join %s t5 on (t3.pid = t5.pid)\n\t\t\t\t\twhere gid = %d\n\t\t\t\t\torder by %s\n\t\t\t\t\t", $tables['games_players'], $tables['players'], $tables['players_rank'], $tables['players'], $tables['players_rank'], $result[gid], $cid ? sprintf("cid != %d, t2.pid", $cid) : ($pid ? sprintf("t2.pid != %d", $pid) : "cid, t2.pid")));
            $plrs = mysql_num_rows($players_result) / 2;
            for ($player_i = 0; $players[$player_i] = mysql_fetch_assoc($players_result); $player_i++) {
            }
            $player_a = 0;
            $player_b = $plrs;
            printf("tr1a(%d,%d,new Array(%s,%s),%d,'%s',%d,%d,%d,%d,%d,%d);", $result[gid], $result[ws_gid], echo_player($players[$player_a++]), echo_player($players[$player_b++]), $result['dura'], js_encode($result['scen']), $result['mtime'], $result['afps'], $result['crat'], $result['oosy'], $result['trny'], $unfair_games);
            while ($player_a < $plrs) {
                printf("tr1d(new Array(%s,%s));", echo_player($players[$player_a++]), echo_player($players[$player_b++]));
            }
        } while ($result = mysql_fetch_assoc($results));
    } else {
        echo "tr1g();";
    }
    echo "tr1h();";
}
예제 #29
0
파일: slideshow.php 프로젝트: rb26/zenphoto
    static function getShow($heading, $speedctl, $albumobj, $imageobj, $width, $height, $crop, $shuffle, $linkslides, $controls, $returnpath, $imagenumber)
    {
        global $_zp_gallery, $_zp_gallery_page;
        setOption('slideshow_' . $_zp_gallery->getCurrentTheme() . '_' . stripSuffix($_zp_gallery_page), 1);
        if (!$albumobj->isMyItem(LIST_RIGHTS) && !checkAlbumPassword($albumobj)) {
            return '<div class="errorbox" id="message"><h2>' . gettext('This album is password protected!') . '</h2></div>';
        }
        $slideshow = '';
        $numberofimages = $albumobj->getNumImages();
        // setting the image size
        if ($width) {
            $wrapperwidth = $width;
        } else {
            $width = $wrapperwidth = getOption("slideshow_width");
        }
        if ($height) {
            $wrapperheight = $height;
        } else {
            $height = $wrapperheight = getOption("slideshow_height");
        }
        if ($numberofimages == 0) {
            return '<div class="errorbox" id="message"><h2>' . gettext('No images for the slideshow!') . '</h2></div>';
        }
        $option = getOption("slideshow_mode");
        // jQuery Cycle slideshow config
        // get slideshow data
        $showdesc = getOption("slideshow_showdesc");
        // slideshow display section
        $validtypes = array('jpg', 'jpeg', 'gif', 'png', 'mov', '3gp');
        $slideshow .= '
				<script type="text/javascript">
				// <!-- <![CDATA[
				$(document).ready(function(){
				$(function() {
				var ThisGallery = "' . html_encode($albumobj->getTitle()) . '";
				var ImageList = new Array();
				var TitleList = new Array();
				var DescList = new Array();
				var ImageNameList = new Array();
				var DynTime=(' . (int) getOption("slideshow_timeout") . ');
				';
        $images = $albumobj->getImages(0);
        if ($shuffle) {
            shuffle($images);
        }
        for ($imgnr = 0, $cntr = 0, $idx = $imagenumber; $imgnr < $numberofimages; $imgnr++, $idx++) {
            if (is_array($images[$idx])) {
                $filename = $images[$idx]['filename'];
                $album = newAlbum($images[$idx]['folder']);
                $image = newImage($album, $filename);
            } else {
                $filename = $images[$idx];
                $image = newImage($albumobj, $filename);
            }
            $ext = slideshow::is_valid($filename, $validtypes);
            if ($ext) {
                if ($crop) {
                    $img = $image->getCustomImage(NULL, $width, $height, $width, $height, NULL, NULL, NULL, NULL);
                } else {
                    $maxwidth = $width;
                    $maxheight = $height;
                    getMaxSpaceContainer($maxwidth, $maxheight, $image);
                    $img = $image->getCustomImage(NULL, $maxwidth, $maxheight, NULL, NULL, NULL, NULL, NULL, NULL);
                }
                $slideshow .= 'ImageList[' . $cntr . '] = "' . $img . '";' . "\n";
                $slideshow .= 'TitleList[' . $cntr . '] = "' . js_encode($image->getTitle()) . '";' . "\n";
                if ($showdesc) {
                    $desc = $image->getDesc();
                    $desc = str_replace("\r\n", '<br />', $desc);
                    $desc = str_replace("\r", '<br />', $desc);
                    $slideshow .= 'DescList[' . $cntr . '] = "' . js_encode($desc) . '";' . "\n";
                } else {
                    $slideshow .= 'DescList[' . $cntr . '] = "";' . "\n";
                }
                if ($idx == $numberofimages - 1) {
                    $idx = -1;
                }
                $slideshow .= 'ImageNameList[' . $cntr . '] = "' . urlencode($filename) . '";' . "\n";
                $cntr++;
            }
        }
        $slideshow .= "\n";
        $numberofimages = $cntr;
        $slideshow .= '
				var countOffset = ' . $imagenumber . ';
				var totalSlideCount = ' . $numberofimages . ';
				var currentslide = 2;
				function onBefore(curr, next, opts) {
				if (opts.timeout != DynTime) {
				opts.timeout = DynTime;
		}
		if (!opts.addSlide)
		return;
		var currentImageNum = currentslide;
		currentslide++;
		if (currentImageNum == totalSlideCount) {
		opts.addSlide = null;
		return;
		}
		var relativeSlot = (currentslide + countOffset) % totalSlideCount;
		if (relativeSlot == 0) {relativeSlot = totalSlideCount;}
		var htmlblock = "<span class=\\"slideimage\\"><h4><strong>" + ThisGallery + ":</strong> ";
		htmlblock += TitleList[currentImageNum]  + " (" + relativeSlot + "/" + totalSlideCount + ")</h4>";
		';
        if ($linkslides) {
            if (MOD_REWRITE) {
                $slideshow .= 'htmlblock += "<a href=\\"' . pathurlencode($albumobj->name) . '/"+ImageNameList[currentImageNum]+"' . getOption('mod_rewrite_image_suffix') . '\\">";';
            } else {
                $slideshow .= 'htmlblock += "<a href=\\"index.php?album=' . pathurlencode($albumobj->name) . '&image="+ImageNameList[currentImageNum]+"\\">";';
            }
        }
        $slideshow .= ' htmlblock += "<img src=\\"" + ImageList[currentImageNum] + "\\"/>";';
        if ($linkslides) {
            $slideshow .= ' htmlblock += "</a>";';
        }
        $slideshow .= 'htmlblock += "<p class=\\"imgdesc\\">" + DescList[currentImageNum] + "</p></span>";';
        $slideshow .= 'opts.addSlide(htmlblock);';
        $slideshow .= '}';
        $slideshow .= '
				function onAfter(curr, next, opts){
				';
        if (!$albumobj->isMyItem(LIST_RIGHTS)) {
            $slideshow .= '
					//Only register at hit count the first time the image is viewed.
					if ($(next).attr("viewed") != 1) {
					$.get("' . FULLWEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/slideshow/slideshow-counter.php?album=' . pathurlencode($albumobj->name) . '&img="+ImageNameList[opts.currSlide]);
					$(next).attr("viewed", 1 );
				}
				';
        }
        $slideshow .= '}';
        $slideshow .= '
				$("#slides").cycle({
				fx:     "' . getOption("slideshow_effect") . '",
				speed:   "' . getOption("slideshow_speed") . '",
				timeout: DynTime,
				next:   "#next",
				prev:   "#prev",
				cleartype: 1,
				before: onBefore,
				after: onAfter
		});

		$("#speed").change(function () {
		DynTime = this.value;
		return false;
		});

		$("#pause").click(function() { $("#slides").cycle("pause"); return false; });
		$("#play").click(function() { $("#slides").cycle("resume"); return false; });
		});

		});	// Documentready()
		// ]]> -->
		</script>
		<div id="slideshow" style="height:' . ($wrapperheight + 40) . 'px; width:' . $wrapperwidth . 'px;">
		';
        // 7/21/08dp
        if ($speedctl) {
            $slideshow .= '<div id="speedcontrol">';
            // just to keep it away from controls for sake of this demo
            $minto = getOption("slideshow_speed");
            while ($minto % 500 != 0) {
                $minto += 100;
                if ($minto > 10000) {
                    break;
                }
                // emergency bailout!
            }
            $dflttimeout = (int) getOption("slideshow_timeout");
            /* don't let min timeout = speed */
            $thistimeout = $minto == getOption("slideshow_speed") ? $minto + 250 : $minto;
            $slideshow .= 'Select Speed: <select id="speed" name="speed">';
            while ($thistimeout <= 60000) {
                // "around" 1 minute :)
                $slideshow .= "<option value={$thistimeout} " . ($thistimeout == $dflttimeout ? " selected='selected'>" : ">") . round($thistimeout / 1000, 1) . " sec</option>";
                /* put back timeout to even increments of .5 */
                if ($thistimeout % 500 != 0) {
                    $thistimeout -= 250;
                }
                $thistimeout += $thistimeout < 1000 ? 500 : ($thistimeout < 10000 ? 1000 : 5000);
            }
            $slideshow .= '</select> </div>';
        }
        if ($controls) {
            $slideshow .= '
					<div id="controls">
					<div>
					<a href="#" id="prev" title="' . gettext("Previous") . '"></a>
					<a href="' . html_encode($returnpath) . '" id="stop" title="' . gettext("Stop and return to album or image page") . '"></a>
					<a href="#" id="pause" title="' . gettext("Pause (to stop the slideshow without returning)") . '"></a>
					<a href="#" id="play" title="' . gettext("Play") . '"></a>
					<a href="#" id="next" title="' . gettext("Next") . '"></a>
					</div>
					</div>
					';
        }
        $slideshow .= '
				<div id="slides" class="pics">
				';
        if ($cntr > 1) {
            $cntr = 1;
        }
        for ($imgnr = 0, $idx = $imagenumber; $imgnr <= $cntr; $idx++) {
            if ($idx >= $numberofimages) {
                $idx = 0;
            }
            if (is_array($images[$idx])) {
                $folder = $images[$idx]['folder'];
                $dalbum = newAlbum($folder);
                $filename = $images[$idx]['filename'];
                $image = newImage($dalbum, $filename);
                $imagepath = FULLWEBPATH . ALBUM_FOLDER_EMPTY . $folder . "/" . $filename;
            } else {
                $folder = $albumobj->name;
                $filename = $images[$idx];
                //$filename = $animage;
                $image = newImage($albumobj, $filename);
                $imagepath = FULLWEBPATH . ALBUM_FOLDER_EMPTY . $folder . "/" . $filename;
            }
            $ext = slideshow::is_valid($filename, $validtypes);
            if ($ext) {
                $imgnr++;
                $slideshow .= '<span class="slideimage"><h4><strong>' . $albumobj->getTitle() . gettext(":") . '</strong> ' . $image->getTitle() . ' (' . ($idx + 1) . '/' . $numberofimages . ')</h4>';
                if ($ext == "3gp") {
                    $slideshow .= '</a>
							<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="352" height="304" codebase="http://www.apple.com/qtactivex/qtplugin.cab">
							<param name="src" value="' . pathurlencode(internalToFilesystem($imagepath)) . '"/>
							<param name="autoplay" value="false" />
							<param name="type" value="video/quicktime" />
							<param name="controller" value="true" />
							<embed src="' . pathurlencode(internalToFilesystem($imagepath)) . '" width="352" height="304" autoplay="false" controller"true" type="video/quicktime"
							pluginspage="http://www.apple.com/quicktime/download/" cache="true"></embed>
							</object>
							<a>';
                } elseif ($ext == "mov") {
                    $slideshow .= '</a>
							<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="640" height="496" codebase="http://www.apple.com/qtactivex/qtplugin.cab">
							<param name="src" value="' . pathurlencode(internalToFilesystem($imagepath)) . '"/>
							<param name="autoplay" value="false" />
							<param name="type" value="video/quicktime" />
							<param name="controller" value="true" />
							<embed src="' . pathurlencode(internalToFilesystem($imagepath)) . '" width="640" height="496" autoplay="false" controller"true" type="video/quicktime"
							pluginspage="http://www.apple.com/quicktime/download/" cache="true"></embed>
							</object>
							<a>';
                } else {
                    if ($linkslides) {
                        $slideshow .= '<a href="' . html_encode($image->getLink()) . '">';
                    }
                    if ($crop) {
                        $img = $image->getCustomImage(NULL, $width, $height, $width, $height, NULL, NULL, NULL, NULL);
                    } else {
                        $maxwidth = $width;
                        $maxheight = $height;
                        getMaxSpaceContainer($maxwidth, $maxheight, $image);
                        $img = $image->getCustomImage(NULL, $maxwidth, $maxheight, NULL, NULL, NULL, NULL, NULL, NULL);
                    }
                    $slideshow .= '<img src="' . html_encode(pathurlencode($img)) . '" alt="" />';
                    if ($linkslides) {
                        $slideshow .= '</a>';
                    }
                }
                if ($showdesc) {
                    $desc = $image->getDesc();
                    $desc = str_replace("\r\n", '<br />', $desc);
                    $desc = str_replace("\r", '<br />', $desc);
                    $slideshow .= '<p class="imgdesc">' . $desc . '</p>';
                }
                $slideshow .= '</span>';
            }
        }
        $slideshow .= '
		</div>
		</div>
		';
        return $slideshow;
    }
예제 #30
0
파일: poker.php 프로젝트: Kuzat/kofradia
    protected function show_create()
    {
        if ($this->is_starter) {
            return;
        }
        $innsats = login::data_get("poker_siste_innsats", 10000);
        if (bccomp($innsats, $this->up->data['up_cash']) == 1) {
            $innsats = $this->up->data['up_cash'];
        }
        ess::$b->page->add_js_domready('
	var player_cash = ' . js_encode(game::format_cash($this->up->data['up_cash'])) . ';
	var elm = $("poker_amount_set");
	var elm_t = $("poker_amount");
	
	elm
		.appendText(" (")
		.grab(new Element("a", {"text":"velg alt"}).addEvent("click", function()
		{
			elm_t.set("value", player_cash);
		}))
		.appendText(")");');
        echo '
<div class="bg1_c xsmall">
	<h1 class="bg1">Nytt pokerspill<span class="left"></span><span class="right"></span></h1>
	<p class="h_right"><a href="' . ess::$s['relative_path'] . '/node/28">Hjelp</a></p>
	<div class="bg1">
		<form action="" method="post">
			<dl class="dd_right">
				<dt id="poker_amount_set">Beløp</dt>
				<dd><input type="text" id="poker_amount" name="amount" value="' . game::format_cash($innsats) . '" class="styled w120" /> ' . show_sbutton("Start") . '</dd>
			</dl>
		</form>
	</div>
</div>';
    }