Ejemplo n.º 1
0
function metaform()
{
    if (isset($_REQUEST['form_name'])) {
        $GLOBALS['form_name'] = format_varname($_REQUEST['form_name']);
        $GLOBALS['singular'] = format_varname($_REQUEST['singular']);
        tem_set('singular', $GLOBALS['singular']);
        $GLOBALS['opt_email'] = format_yesno($_REQUEST['opt_email']);
        tem_set('opt_email', $GLOBALS['opt_email']);
        $GLOBALS['opt_db'] = format_yesno($_REQUEST['opt_db']);
        tem_set('opt_db', $GLOBALS['opt_db']);
        $GLOBALS['opt_listing'] = format_yesno($_REQUEST['opt_listing']);
        tem_set('opt_listing', $GLOBALS['opt_listing']);
        $GLOBALS['opt_display'] = format_yesno($_REQUEST['opt_display']);
        tem_set('opt_display', $GLOBALS['opt_display']);
        $GLOBALS['opt_http_pass'] = format_yesno($_REQUEST['opt_http_pass']);
        tem_set('opt_http_pass', $GLOBALS['opt_http_pass']);
    } else {
        $GLOBALS['form_name'] = 'some_form';
    }
    if (isset($_REQUEST['fields'])) {
        if (isset($_REQUEST['view_sql'])) {
            view_sql();
            exit;
        } elseif (isset($_REQUEST['view_php'])) {
            view_php();
            exit;
        } elseif (isset($_REQUEST['view_html'])) {
            view_html();
            exit;
        } elseif (isset($_REQUEST['view_email'])) {
            view_email();
            exit;
        } elseif (isset($_REQUEST['download_tar'])) {
            download_tar();
            exit;
        } elseif (isset($_REQUEST['preview'])) {
            preview();
            exit;
        } elseif (isset($_REQUEST['edit'])) {
            tem_set('fields', $_REQUEST['fields']);
            tem_set('form_name', $GLOBALS['form_name']);
            # fall through
        } else {
            die("Sorry... couldn't tell which button you pressed");
        }
    }
    set_form_action();
    tem_load('code/wfpl/metaform/main.html');
    list_available_types();
    tem_output();
}
Ejemplo n.º 2
0
	<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
		<div id="page-wrapper">
			<div class="row">
				<div class="col-md-12" style="max-width:638px">
					<h1 style="float:left">Editar <small>artigo ...</small></h1>
					<a class="floatButton btn btn-success btn-lg" href="<?php 
echo map_url();
?>
index">Listar artigos</a>
					<span class="clear floatPreview"><?php 
preview($_GET['id'], $_GET['tipo']);
?>
</span>
				</div>
				<div class="col-md-12" style="max-width:638px">
					<?php 
if (isset($_GET['funcao']) && $_GET['funcao'] == 'atualizar') {
    if (!empty($_GET['tipo']) && !empty($_GET['funcao']) && $_GET['funcao'] == 'atualizar') {
        $id = $_GET['id'];
        $tipo = $_GET['tipo'];
        list_upt_btp_conteudo($id, $tipo);
    }
}
?>
				</div>
			</div>
		</div>  
	</div>    
</div>
Ejemplo n.º 3
0
}
# Control Central
switch ($_GET['command']) {
    case "gallery":
        # Image Gallery
        define("_BBC_PAGE_NAME", "Gallery: " . $dir);
        @(include_once COUNTER);
        # Gallery View
        gallery();
        exit;
    case "slide":
        # Slide Show / Preview Mode
        define("_BBC_PAGE_NAME", "Preview: " . $dir . $file);
        @(include_once COUNTER);
        # Preview View
        preview($file);
        exit;
    case "rss":
        # Generate RSS Feed
        printRSS();
        exit;
    case "captions":
        # Add Image Captions
        # Determine if caption editing is on or off.
        if ($enable_caption_editing) {
            define("_BBC_PAGE_NAME", "Caption:" . $dir . $file);
            @(include_once COUNTER);
            makeCaptions($_POST);
        } else {
            header("Location:" . rrawurlencode($baseURL . $dir));
        }
Ejemplo n.º 4
0
function check_and_move($filename)
{
    global $config, $_POST;
    $info = getimagesize($config['working_dir'] . $filename);
    $final_filename = '';
    switch ($info['mime']) {
        case 'image/gif':
            $ext = 'gif';
            break;
        case 'image/pjpeg':
            $ext = 'jpg';
            break;
        case 'image/jpeg':
            $ext = 'jpg';
            break;
        case 'image/x-png':
            $ext = 'png';
            break;
        case 'image/png':
            $ext = 'png';
            break;
        case 'image/bmp':
            $ext = 'bmp';
            break;
        case 'image/x-ms-bmp':
            $ext = 'bmp';
            break;
        default:
            $ext = 'fail';
            $info['mime'] = 'n/a';
            break;
    }
    $stat = stat($config['working_dir'] . $filename);
    $partes = explode('.', $filename);
    $extension = strtolower($partes[count($partes) - 1]);
    if ($info['mime'] == 'n/a') {
        $local_error[] = "Ошибка: Неверный MIME-тип изображения, допускаются " . implode(', ', $config['mimes']) . ". Вы пытались залить " . $info['mime'];
    } elseif (!in_array($ext, $config['extensions'])) {
        $local_error[] = "Ошибка: Неверное расширение изображения, допускаются " . strtoupper(implode(', ', $config['extensions'])) . ". Вы пытались залить " . strtoupper($extension);
    } elseif ($stat['size'] > $config['max_size_byte']) {
        $local_error[] = "Ошибка: Превышен максимальный размер файла: {$config['max_size_mb']} МБ";
    } elseif ($info['1'] > $config['max_height']) {
        $local_error[] = "Ошибка: Превышена максимальная высота изображения: {$config['max_height']} пикселей";
    } elseif ($info['0'] > $config['max_width']) {
        $local_error[] = "Ошибка: Превышена максимальная ширина изображения: {$config['max_width']} пикселей";
    }
    if (!isset($local_error)) {
        if ($ext == 'bmp') {
            include 'bmp.php';
            $src = imagecreatefrombmp($config['working_dir'] . $filename);
            imagepng($src, $config['working_dir'] . $filename);
            imagedestroy($src);
            $ext = 'png';
            $partes[count($partes) - 1] = $ext;
            $filenamepng = implode(".", $partes);
            if (!rename("{$config['working_dir']}{$filename}", "{$config['working_dir']}{$filenamepng}")) {
                $local_error[] = "Ошибка преобразования изображения";
            }
            $filename = $filenamepng;
            unset($filenamepng);
        }
        $final_filename = random_string($config['random_str_quantity'], 'lower,numbers') . "." . $ext;
        $uploaded_file_path = strtolower($config['uploaddir'] . $config['current_path'] . '/' . $final_filename);
        if (isset($_POST['thumb']) and $_POST['thumb'] == "true") {
            //если пользователь не выставил значение(я) превьюшки
            if ($_POST['thumb_width'] or $_POST['thumb_height']) {
                preview($filename, $final_filename, $_POST['thumb_width'], $_POST['thumb_height'], $config['quality']);
            } else {
                $local_error[] = "Ошибка: Не указан размер превью";
                unlink("{$config['working_dir']}{$filename}");
                exit;
            }
        }
        //если установлено уменьшение
        if (isset($_POST['resize']) and $_POST['resize'] == 'true') {
            if ($_POST['width'] or $_POST['height']) {
                resize("{$config['working_dir']}{$filename}", $_POST['width'], $_POST['height']);
            } else {
                $local_error[] = "Ошибка: Не указан размер уменьшенного рисунка";
                unlink("{$config['working_dir']}{$filename}");
                exit;
            }
        }
        if (!rename("{$config['working_dir']}{$filename}", "{$config['uploaddir']}{$config['current_path']}/{$final_filename}")) {
            $local_error[] = "Ошибка перемещения изображения";
        }
    } else {
        @unlink("{$config['working_dir']}{$filename}");
    }
    if (isset($local_error)) {
        $local_error_string = implode(', ', $local_error);
    } else {
        $local_error_string = '';
    }
    return array($final_filename, $local_error_string);
}
Ejemplo n.º 5
0
function post_show($id, $preview = TRUE, $db, $adm_log = 0)
{
    if (!ctype_digit($id)) {
        alert_try_sqlinj();
        header('Location:index.php?error=error');
        die;
    }
    $id = validate($id, $db);
    $query = 'SELECT post_title,post_logo,p.categ_id,categ_name,post_text,UNIX_TIMESTAMP(post_edit_date) AS post_edit_date,UNIX_TIMESTAMP(post_date) AS post_date FROM posts p JOIN categories c ON p.categ_id=c.categ_id  WHERE  post_id=' . mysql_real_escape_string($id, $db);
    $result = sql_query($query, $db);
    if (mysql_num_rows($result) > 0) {
        while ($row = mysql_fetch_assoc($result)) {
            extract($row);
            echo '<table class=post-tablef>
<tr><td>';
            echo $adm_log == 1 ? '<div>
<span class="span-edit">
<a href="admin_main.php?mode=confirm&submit=post_delete&post_id=' . $id . '">
Delete this post
</a>
||
<a href="admin_main.php?mode=edit_post&post_id=' . $id . '">
Edit this post
</a>
</span>
</div>' : '';
            echo '<div>
<div><span class="span-posttitle">
<a href="view_post.php?id=' . mysql_real_escape_string($id, $db) . '">
' . nl2br(deletenbsp($post_title)) . '
</a>
</span>
</div>
</br>';
            echo '<span class="span-submitted"><strong>
Submitted:</strong>' . htmlspecialchars(date('l F j, Y H:i', $post_date)) . '
</span>
</br>';
            if ($post_edit_date != "") {
                echo '<span class="span-submitted">
<strong>Edit Date:</strong>
' . htmlspecialchars(date('l F j, Y H:i', $post_edit_date)) . '
</span>
</br>';
            }
            echo '
<span class="span-category">
<strong>Category:</strong>
<a href="index.php?categ=' . $categ_id . '">
' . deletenbsp($categ_name) . '
</a>
</span>
</br></br>';
            if ($post_logo != "") {
                echo '<img class="logo_link" src="' . stripslashes(deletescript(html_entity_decode(deletenbsp($post_logo), ENT_QUOTES))) . '"/></br></br>';
            }
            if ($preview) {
                $text = nl2br(stripslashes(preview(htmlsostitution(deletenbsp($post_text)))));
                echo '<table class="post-textf">
<tr>
<td>' . $text;
                if (strlen(nl2br(stripslashes(htmlsostitution(deletenbsp($post_text))))) > MAX_LENGTH_PREVIEW) {
                    echo '</br>
<a href="view_post.php?id=' . $id . '">
More
</a>';
                }
                echo '</td>
</tr>
</table>';
            } else {
                echo '<table class="post-textf">
<tr>
<td>
' . nl2br(stripslashes(htmlsostitution(deletenbsp($post_text)))) . '
</td>
</tr>
</table>';
            }
            echo '</br>
<div>
<strong>
Tags:
</strong></br>
<span class="span-tags">';
            $query = 'SELECT * FROM
tags t JOIN posttags pt ON t.tag_id=pt.tag_id
WHERE
pt.post_id= ' . mysql_real_escape_string($id, $db) . ' ORDER BY t.tag_name ASC ';
            $result = sql_query($query, $db);
            if (mysql_num_rows($result) > 0) {
                while ($row = mysql_fetch_array($result)) {
                    extract($row);
                    echo $tag_name . '; ';
                }
            } else {
                echo 'No tags for this post';
            }
            echo '</span>
</div></br>';
            if (!$preview) {
                add_view($id, $db);
                echo '<span style="font-size:15px;">' . get_views($id, $db) . '</span></br>';
                show_tag_posts($id, $db);
                show_comments($id, $db);
            }
            if ($preview) {
                $query = 'SELECT * FROM comments 
WHERE 
post_id=' . mysql_real_escape_string($id, $db);
                $result2 = sql_query($query, $db);
                echo '<span style="font-size:15px;">' . get_views($id, $db) . ',<a href="view_post.php?id=' . $id . '">
Comments:' . mysql_num_rows($result2) . '
</a>
</span>
</div>';
            }
        }
        mysql_free_result($result);
    } else {
        echo 'Article Not found';
    }
    echo '</td>
</tr>';
    echo '</table>
</br>';
}
Ejemplo n.º 6
0
function display_seq($row)
{
    echo '<div class="game"><a href="/' . $row['id'] . '">' . preview($row['id'], $row['title']) . '</a></div>';
}
Ejemplo n.º 7
0
<?php

$featured = array(array(67179, "Gracious Intervention", "Wafels"), array(67844, "Angel Beats", "Sora"), array(55030, "TechnoTechnoTechnoooo!", "hmyj"), array(66964, "The Legend of Zelda Overworld Theme", ""), array(64836, "No Game No Life", "MiniRunaway"), array(44487, "The Lord of the Rings Melody", "zoyd11"), array(34334, "8 Awesome Angles of Youtube! Part One", ""));
if (!defined('IN_SITE')) {
    require '../inc/init.php';
}
$limit = 12;
/*echo '<div id="featured" style="display:none">';
for($i = 0; $i < 4; $i++) {
    $seq = $featured[rand(0, count($featured)-1)];
    echo '<a href="/'.$seq[0].'" onclick="return onSequenceLinkClick(event, '.$seq[0].')"><img width="131" height="131" src="/preview.php?v=2&id='.$seq[0].'&title='.urlencode($seq[1]).'"/>';
}
echo '</div>';*/
echo '<div id="random">';
$result = db_query('SELECT *
  FROM sequences WHERE ' . randomSequences($limit) . ' LIMIT ' . $limit);
while ($row = mysqli_fetch_array($result)) {
    echo '<a href="/' . $row['id'] . '" onclick="return onSequenceLinkClick(event, ' . $row['id'] . ')">' . preview($row['id'], $row['title']) . '</a>';
}
echo '</div>
<div id="popular" style="display:none">';
$result = db_query('SELECT *
  FROM sequences WHERE deleted=0 AND ' . time() . '-date < 2628000 ORDER BY accesscount DESC LIMIT ' . $limit);
while ($row = mysqli_fetch_array($result)) {
    echo '<a href="/' . $row['id'] . '" onclick="navigate(' . $row['id'] . '); return false;">' . preview($row['id'], $row['title']) . '</a>';
}
echo '</div>';
$currentId = isset($id) ? $id : intval($_GET['id']);
echo '<div id="like_button">
<iframe src="//www.facebook.com/plugins/like.php?href=' . $settings['domain'] . '/' . ($currentId == 0 ? '' : $currentId) . '&amp;width=131&amp;layout=button_count&amp;action=like&amp;show_faces=true&amp;share=true&amp;height=21&amp;appId=502727419751398" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:131px; height:21px;" allowTransparency="true"></iframe>
</div>';
Ejemplo n.º 8
0
     global $HTTP_POST_VARS, $settings, $userdata, $locale;
     $name = array("background", "ear", "face", "fhair", "eyebrow", "eyes", "nose", "mouth", "dress", "others");
     $code = array("bg", "ear", "fc", "fhr", "eb", "eye", "ns", "mo", "cl", "oth");
     $constant = array($locale['ugam_205'], $locale['ugam_207'], $locale['ugam_208'], $locale['ugam_209'], $locale['ugam_210'], $locale['ugam_211'], $locale['ugam_212'], $locale['ugam_213'], $locale['ugam_214'], $locale['ugam_215']);
     for ($i = 0; $i < count($name); $i++) {
         make_table($name[$i], $code[$i], $constant[$i], $i + 1);
         links();
     }
 }
 function close()
 {
     echo "</form>\n";
 }
 switch ($op) {
     case 'preview':
         preview();
         form();
         close();
         break;
     case 'store':
         store();
         break;
     default:
         head_form();
         form();
         close();
         break;
 }
 closetable();
 //Start Copywrite Link removal is NOT ALLOWED.
 echo "<div align='center' class='small'>" . $locale['ugam_title'] . " " . $locale['ugam_version'] . " &copy; 2007-2008 <a href='http://www.starglowone.com'>Stars Heaven</a></div>\n";
Ejemplo n.º 9
0
function metaCertificateDispatch($op)
{
    if (isset($_POST['undo'])) {
        $op = 'meta_certificate';
    }
    if (isset($_POST['undo_assign']) || isset($_POST['cancelselector']) || isset($_POST['undo_filter'])) {
        $op = 'assign';
    }
    switch ($op) {
        case 'meta_certificate':
            metaCertificate();
            break;
        case 'addmetacertificate':
            editMetaCertificate();
            break;
        case 'modmetacertificate':
            editMetaCertificate(true);
            break;
        case 'savemetacertificate':
            saveMetaCertificate();
            break;
        case 'elemmetacertificate':
            list_element_meta_certificate();
            break;
        case 'delmetacertificate':
            delMetaCertificate();
            break;
        case 'assign':
            assignMetaCertificate();
            break;
        case 'viewdetails':
            viewDetails();
            break;
        case 'new_assign':
            newAssignMetaCertificate();
            break;
        case 'delassignmetacertificate':
            delAssignMetaCertificate();
            break;
        case 'modassignmetacertificate':
            modAssignMetaCertificate();
            break;
        case 'modassignment':
            modAssignmentAssignMetaCertificate();
            break;
        case 'preview':
            preview();
            break;
        case 'create':
            create();
            break;
        case 'preview_cert':
            preview_cert();
            break;
        case 'release_cert':
            release_cert();
            break;
        case 'del_released':
            delReleased();
            break;
        default:
            metaCertificate();
            break;
    }
}
Ejemplo n.º 10
0
function pcertificateDispatch($op)
{
    if (isset($_POST['undo'])) {
        $op = 'certificate';
    }
    if (isset($_POST['undo_report'])) {
        $op = 'report_certificate';
    }
    if (isset($_POST['certificate_course_selection'])) {
        $op = 'view_report_certificate';
    }
    if (isset($_POST['certificate_course_selection_back'])) {
        $op = 'report_certificate';
    }
    switch ($op) {
        case "elemcertificate":
            list_element_certificate();
            break;
        case "view_report_certificate":
            view_report_certificate();
            break;
        case "del_report_certificate":
            del_report_certificate();
            break;
        case "send_certificate":
            send_certificate();
            break;
        case "print_certificate":
            print_certificate();
            break;
        case "preview":
            preview();
            break;
    }
}
Ejemplo n.º 11
0
<?php

include "lib.php";
$render = isset($_REQUEST['render']);
$openscad_params = $_REQUEST['openscad_params'];
// $openscad_params=array(
//   'nome'=>'oda',
//   'tamanho_da_fonte'=>10,
//   'nome_x'=>17,
//   'nome_y'=>18,
//   'altura_do_vao_do_cabo'=>12,
//   'vao_do_cabo_y'=>17
// );
$file = preview($openscad_params, $render);
$img = imagecreatefrompng($file);
header('Content-Type: image/png');
imagepng($img);
imagedestroy($img);
Ejemplo n.º 12
0
<?php

require_once dirname(__FILE__) . '/local/loc.init_public.php';
/*-----------------------------------------------------------------------
	POST hook
-----------------------------------------------------------------------*/
if (isset($_POST['preview'])) {
    preview($_POST['table'], $_POST['backup_file'], $_POST['path']);
}
if (isset($_POST['restore'])) {
    restore($_POST['table'], $_POST['backup_file'], $_POST['path']);
}
if (isset($_POST['get_backup'])) {
    echo print_all_backup_file($_POST['table']);
}
/*-----------------------------------------------------------------------
	Return the list of field name in an array
-----------------------------------------------------------------------*/
function print_table($table)
{
    global $mysql;
    $sql = "SELECT * FROM {$table}";
    $result = $mysql->sql_query($sql);
    $numFields = mysqli_num_fields($result);
    while ($data = mysqli_fetch_assoc($result)) {
        $cpt = 1;
        foreach ($data as $info) {
            $html .= $info;
            if ($cpt == $numFields) {
                $html .= '<br />';
            } else {
Ejemplo n.º 13
0
    $contents = fread($handle, filesize($filename));
    fclose($handle);
    include JPATH_COMPONENT . DS . 'language/' . $contents;
}
//echo $mainframe->getSiteURL();
require_once JPATH_COMPONENT . DS . 'admin.swmenupro.html.php';
//require_once( JPATH_COMPONENT.DS.'language'.DS.'english.php' ) ;
require_once JPATH_COMPONENT . DS . "admin.swmenupro.class.php";
$cid = JRequest::getVar('cid', array(0), 'post');
if (!is_array($cid)) {
    $cid = array(0);
}
//JTable::addTableDir(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_swmenupro'.DS.'tables');
switch (JRequest::getVar('task')) {
    case 'preview':
        preview($cid[0], $option);
        break;
    case 'images':
        imageManager($cid[0], $option);
        break;
    case 'imageFiles':
        imageFiles($cid[0], $option);
        break;
    case "new":
        editModule('0', $option);
        break;
    case "saveedit":
        saveconfig($cid[0], $option);
        break;
    case 'uploadfile':
        uploadPackage();
Ejemplo n.º 14
0
 public function logo()
 {
     try {
         $file_original = $this->request->input('file_original');
         $file_crop = $this->request->input('file_crop');
         $options = unserialize($this->request->input('options'));
         $options = \Azat\Adminka\LogoController::handleOptions($file_original, $options);
         return \Response::json(['status' => 'ok', 'preview' => preview('auto', $options['previewWidth'] . "x" . $options['previewHeight'], $file_original), 'file_original' => $file_original, 'file_crop' => $file_crop, 'options' => $options, 'serialize_options' => serialize($options)]);
     } catch (\Exception $e) {
         return \Response::json(['status' => 'error']);
     }
 }
Ejemplo n.º 15
0
 public static function handleOptions($file = null, $options = [])
 {
     $options = array_map(function ($elem) {
         return (int) $elem;
     }, $options);
     $options = array_merge(self::$options, $options);
     if (!$file) {
         return $options;
     }
     $options['selWidth'] = !isset($options['selWidth']) ? $options['cropWidth'] : $options['selWidth'];
     $options['selHeight'] = !isset($options['selHeight']) ? $options['cropHeight'] : $options['selHeight'];
     $k = $options['selWidth'] / $options['selHeight'];
     $preview = Image::make(preview('auto', $options['previewWidth'] . 'x' . $options['previewHeight'], $file, true));
     if ($options['selWidth'] > $preview->width()) {
         $options['selWidth'] = $preview->width();
         $options['selHeight'] = (int) ($preview->width() / $k);
     }
     $k = $options['selHeight'] / $options['selWidth'];
     if ($options['selHeight'] > $preview->height()) {
         $options['selHeight'] = $preview->height();
         $options['selWidth'] = (int) ($preview->height() / $k);
     }
     $options['minSelWidth'] = (int) ($options['selWidth'] / 2);
     $options['minSelHeight'] = (int) ($options['selHeight'] / 2);
     return $options;
 }
Ejemplo n.º 16
0
Archivo: admin.php Proyecto: dawaa/taco
  <head>
    <meta charset="utf-8">
    <title>Admin &raquo; Sombrero</title>
    <link href='https://fonts.googleapis.com/css?family=Lato:100,300,400,700,900' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic,700,700italic,800,800italic">
    <link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900">
    <link rel="stylesheet" type="text/css" href="http://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
    <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="/lib/taco-css/main.css">
    <link rel="stylesheet" type="text/css" href="css/main.css">
  </head>
  <body data-page="<?php 
echo $page['page-slug'];
?>
"<?php 
preview($page);
?>
>
    <header id="admin-header">
      <div class="wrapper" flex="row large">
        <div flex="column sm-12 row-wrap v-center space-between">
          <div class="left">
            <div id="nav-toggle"><i class="ion-navicon"></i></div>
            <span id="page-title"><?php 
echo ucfirst($page_slugs[0]);
?>
</span>
            <nav id="main-nav">
              <ul>
                <li><a href="/sr-admin/dashboard?section=home"><i class="fa fa-tachometer"></i><span>Dashboard</span></a></li>
                <li class="active"><a href="/sr-admin/site?section=pages"><i class="fa fa-file-text"></i><span>Site</span></a></li>