function baseaddress() { $www_required = www_required(); if ($www_required) { $www = 'www.'; } else { $www = ''; } return 'http://' . $www . domain() . basepath(); }
/** * Build the chapter navigation sub pages * @param string $path * @return string */ function renderChapterNavigation($path) { $objects = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::SELF_FIRST); $items = array(); foreach ($objects as $o) { $filename = $o->getFileName(); $re = '/ch([0-9]{1,2})\\.html/'; preg_match($re, $filename, $matches); if (count($matches) == 2) { $filename = basename($filename, '.html'); $filepath = '/' . $path . '/' . $filename; $items[$matches[1]] = $filepath; } } ksort($items); $html = ''; foreach ($items as $num => $href) { $href = basepath() . $href; $html .= '<li>' . '<a class="page chapter"' . ' href="' . $href . '">' . 'Chapter ' . $num . '</a>' . '</li>' . PHP_EOL; } return $html; }
function show_doc($doc, $size, $listdir, $icon) { $size = $this->parse_size($size); $doc_url_link = COM_MEDIA_BASEURL . $listdir . '/' . rawurlencode($doc); $overlib = 'Filesize: ' . $size; $overlib .= '<br/><br/> *Click for URL*'; ?> <div style="float:left; padding: 5px"> <div class="imgTotal" onmouseover="return overlib( '<?php echo $overlib; ?> ', CAPTION, '<?php echo $doc; ?> ', BELOW, RIGHT, WIDTH, 200 );" onmouseout="return nd();"> <div align="center" class="imgBorder"> <!-- <a href="index.php?mod=media&task=list&listdir=<?php echo $listdir; ?> " onclick="javascript:window.top.document.forms[0].imagecode.value = '<a href="<?php echo $doc_url_link; ?> ">Insert your text here</a>';"> --> <a onclick="javascript:window.top.document.forms[0].imagecode.value = '<a href="<?php echo $doc_url_link; ?> ">Insert your text here</a>';"> <img border="0" src="<?php echo $icon; ?> " alt="<?php echo $doc; ?> " /></a> </div> </div> <div class="imginfoBorder"> <small> <?php echo $doc; ?> </small> <div class="buttonOut"> <a href="<?php site_url('admin/media/delete/' . $doc . '/' . $listdir); ?> " target="_top" onclick="return deleteImage('<?php echo $doc; ?> ');"> <img src="<?php echo basepath(); ?> images/edit_trash.gif" width="15" height="15" border="0" alt="Delete" /></a> </div> </div> </div> <?php }
use Bloge\Apps\AdvancedApp; use Bloge\Content\Advanced; use Bloge\Content\PHP as Content; use Bloge\Renderers\Jade as Renderer; use Volter\Data; use Volter\URL; /** * Bloge app * * @package volter9.github.io */ $parsedown = Bloge\process('content', [new Parsedown(), 'text']); $renderer = new Renderer(basepath('theme')); $content = new Advanced(new Content(basepath('content'))); /** * Dispatcher: ignore private folders and map 404 and feed to files */ $content->dispatcher()->map(require 'content/_data/mappings.php')->ignore(Bloge\rFilter('/^_|\\/_/')); /** * Processor: process markdown inside of the articles */ $content->processor()->add(function ($route, array $data) use($parsedown) { return @$data['processor'] === 'markdown' ? $parsedown($route, $data) : $data; }); /** * DataMapper: map default variables, route and content map */ $content->dataMapper()->mapAll(['container' => $content, 'theme' => $renderer, 'view' => 'templates/post.jade', 'data' => new Data(basepath('content/_data')), 'url' => new URL(FULL_URL, URL::baseUrl(__DIR__))])->mapAll(function ($route) { return compact('route'); })->map(require 'content/_data/data.php'); return new AdvancedApp($content, $renderer);
<tr> <td> <table border="0" cellspacing="1" cellpadding="3" class="adminheading"> <tr> <td> Directory </td> <td> <?php echo $dirpath; ?> </td> <td class="buttonOut" width="10"> <a href="javascript:dirup()"> <img src="<?php echo basepath(); ?> images/btnFolderUp.gif" width="15" height="15" border="0" alt="Up" /> </a> </td> <td align="right"> File Upload <input class="inputbox" type="file" name="upload" id="upload" size="63" /> </td> </tr> </table> </td> </tr> <tr> <td align="center" bgcolor="white">
<?php require 'vendor/autoload.php'; require 'src/router.php'; require 'src/helpers.php'; try { $dotenv = new Dotenv\Dotenv(__DIR__); $dotenv->load(); } catch (Exception $e) { //assumes sys ENV instead } $router = new DDARRouter(basepath()); $router->load(); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>DDAR</title> <link rel="stylesheet" href="<?php echo urlfor('/styles/bootstrap/bootstrap.min.css'); ?> "/> <link rel="stylesheet" href="<?php echo urlfor('/styles/bootstrap/bootstrap-theme.min.css'); ?> "/> <link rel="stylesheet" href="<?php echo urlfor('/styles/fancybox/jquery.fancybox.css?v=2.1.5');
$player_name = $row['name']; } mysql_free_result($result); // PMComposer needs some classes to be already set up. // It will be easier when this file is replaced with an add-on. require dirname(dirname(__FILE__)) . '/CMS/classes/config.php'; global $config; $config = new config(); require dirname(dirname(__FILE__)) . '/CMS/classes/db.php'; global $db; $db = new database(); require dirname(dirname(__FILE__)) . '/CMS/add-ons/pmSystem/classes/PMComposer.php'; $pmComposer = new pmComposer(); $pmComposer->setSubject("Invitation to team {$team_name}"); // TODO: do not assume that BBCode is enabled $pmComposer->setContent("Congratulations, you were invited by {$player_name} to join team " . htmlent_decode($team_name) . "!\n\n[URL=\"" . basepath() . "Teams/?join={$invited_to_team}\"]Click here to accept the invitation.[/URL]\n\nYou must leave your current team before accepting an invitation to a new team.\n\nThe invitation will expire in 7 days."); $pmComposer->setTimestamp(date('Y-m-d H:i:s')); $pmComposer->addUserID($profile); $pmComposer->send(); echo '<div class="static_page_box">' . "\n"; echo '<p>The player was invited successfully.</p>' . "\n"; // invitation and notification was sent $site->dieAndEndPage(''); } if ($allow_invite_in_any_team || $leader_of_team_with_id > 0) { echo '<div class="static_page_box">' . "\n"; echo '<form enctype="application/x-www-form-urlencoded" method="post" action="?invite=' . htmlentities(urlencode($profile)) . '">' . "\n"; echo '<div>'; $site->write_self_closing_tag('input type="hidden" name="confirmed" value="1"'); echo '</div>' . "\n"; // display team picker in case the user can invite a player to any team