<?php require 'header.php'; $id = $_GET['id']; $row = get_news_by_id($id); $path = get_image_src($id, 'update'); copy_image($path); ?> <div id="updatenews"style="margin-left:150px;"> <div style="float:left"> <table> <tr><td class="text"id="title_text"><h4 >Վերնագիր</h4></td></tr> <tr><td><textarea rows="4" cols="10" name="title" id="newstitle"><?php echo $row['title']; ?> </textarea></td></tr> <tr><td class="text" id="content_text"><h4 >Բովանդակ.</h4></td></tr> <tr><td><textarea rows="10" cols="10" name="content" id="content"><?php echo $row['content']; ?> </textarea></td></tr> <tr><td class="text" id="video_title"><h4>Վիդեո</h4></td></tr> <tr><td><input type="text" name="video" id="video" value='<?php echo $row['video']; ?> ' /></td></tr> <tr><td>Նշել որպես գլխավոր<input id="heading"type="checkbox"style="width:50px;"<?php if ($row['heading']) { echo 'checked'; }
function doUpdateExtraStuff() { global $gbl, $sgbl, $login, $ghtml; lxfile_mkdir("__path_program_etc/flag"); convertIpaddressToComa(); print "Fix extra database\n"; fixExtraDB(); print "Set some defaults\n"; db_set_default('vps', 'ttype', 'openvz'); db_set_default('pserver', 'coma_psrole_a', 'vps'); db_set_default("vps", "swapdiskname", "vm.swap", "ttype = 'xen'"); db_set_default("vps", "maindiskname", "root.img", "ttype = 'xen'"); db_set_default('vps', 'corerootdir', '/vz/private', "ttype = 'openvz'"); db_set_default("vps", "corerootdir", "/home/xen", "ttype = 'xen'"); print "Fixing database passwords\n"; $a = null; fix_mysql_root_password('localhost'); $dbadmin = new Dbadmin(null, 'localhost', "mysql___localhost"); $dbadmin->get(); $pass = $dbadmin->dbpassword; $a['mysql']['dbpassword'] = $pass; slave_save_db("dbadmin", $a); print "Fixing OS template permissions\n"; lxfile_unix_chmod_rec("/vz/template/cache/", "0755"); lxfile_unix_chmod_rec("/home/hypervm/xen/template/", "0755"); call_with_flag("dofixParentClname"); print "Check License\n"; passthru("{$sgbl->__path_php_path} htmllib/lbin/getlicense.php"); print "Fix OpenVZ resources\n"; fixOpenVZResource(); print "Move clients to client of needed\n"; move_clients_to_client(); print "create backup dirs\n"; add_vps_backup_dir(); print "Parse SQL Data\n"; parse_sql_data(); print "Fix IP POOL\n"; lxshell_return("__path_php_path", "../bin/fix/fixippool.php"); print "Fix IP adresses in database\n"; fix_ipaddress_column_type(); fix_vmipaddress(); print "Checking HIB template\n"; get_kloxo_ostemplate(); print "Set admin email\n"; save_admin_email(); print "Checking Skin Images\n"; copy_image(); system("mysql -u hypervm -p`cat ../etc/conf/hypervm.pass` hypervm1_0 < ../file/interface/interface_template.dump"); if (lxfile_exists("/etc/init.d/libvirtd")) { print "Make sure libvirtd is not started after reboot\n"; system("chkconfig libvirtd off 2>/dev/null"); } if (is_openvz()) { print "Fixing Base OS templates\n"; if (!lxfile_real("/vz/template/cache/centos-5-i386-afull.tar.gz")) { system("mkdir -p /vz/template/cache/ ; cd /vz/template/cache/ ; rm centos-5-i386-afull.tar.gz; wget download.lxcenter.org/download/openvztemplates/base/centos-5-i386-afull.tar.gz "); system("rm /vz/template/cache/index.html* 2>/dev/null"); } } else { if (!lxfile_real("/home/hypervm/xen/template/centos-5-i386-afull.tar.gz")) { system("mkdir -p /home/hypervm/xen/template ; cd /home/hypervm/xen/template/ ; rm centos-5-i386-afull.tar.gz; wget download.lxcenter.org/download/xentemplates/base/centos-5-i386-afull.tar.gz "); system("rm /home/hypervm/xen/template/index.html* 2>/dev/null"); } } print "Fix SSL\n"; fix_self_ssl(); print "Fix database password\n"; critical_change_db_pass(); print "Delete old repo's\n"; if (lxfile_exists("/etc/yum.repos.d/lxlabs.repo")) { lxfile_mv("/etc/yum.repos.d/lxlabs.repo", "/etc/yum.repos.d/lxlabs.repo.lxsave"); system("rm -f /etc/yum.repos.d/lxlabs.repo"); print "Removed lxlabs.repo\n"; } }
/** * Callback for image search pattern, create thumbnail and lightbox * * @param $matches * @return string */ function image_callback($matches) { $filename = $matches[1]; $image_name = $matches[2]; $thumb_size = copy_image(SRC_PATH . '/images', OUTPUT_PATH . '/images', $filename); $thumb_style = "width: {$thumb_size['0']}px; height: {$thumb_size['1']}px;"; $alt_text = ucwords(str_replace('-', ' ', $image_name)); $real_url = 'images/' . $filename; $ext = '.' . pathinfo($filename, PATHINFO_EXTENSION); $thumb_image = '<img style="' . $thumb_style . '" src="images/thumbs/thumb-' . basename($filename, $ext) . '.jpg" alt="' . $alt_text . '">'; $lightbox = "<a href=\"{$real_url}\" data-toggle=\"lightbox\" data-title=\"Изображение: {$filename}\" class=\"img-thumbnail\">{$thumb_image}</a>"; return $lightbox; }