$link = shtmlspecialchars(trim($_POST['link'])); if ($link) { if (!preg_match("/^http\\:\\/\\/.{4,300}\$/i", $link)) { $link = ''; } } if (empty($link)) { showmessage('url_incorrect_format'); } $arr['title_template'] = cplang('share_link'); $arr['body_template'] = '{link}'; $link_text = sub_url($link, 45); $arr['body_data'] = array('link' => "<a href=\"{$link}\" target=\"_blank\">{$link_text}</a>", 'data' => $link); $parseLink = parse_url($link); if (preg_match("/(youku.com|youtube.com|5show.com|ku6.com|sohu.com|mofile.com|sina.com.cn)\$/i", $parseLink['host'], $hosts)) { $flashvar = getFlash($link, $hosts[1]); if (!empty($flashvar)) { $arr['title_template'] = cplang('share_video'); $type = 'video'; $arr['body_data']['flashvar'] = $flashvar; $arr['body_data']['host'] = $hosts[1]; } } // 判断是否音乐 mp3、wma if (preg_match("/\\.(mp3|wma)\$/i", $link)) { $arr['title_template'] = cplang('share_music'); $arr['body_data']['musicvar'] = $link; $type = 'music'; } // 判断是否 Flash if (preg_match("/\\.swf\$/i", $link)) {
opts.type = "notice"; break; } $.pnotify(opts); } $(function(){ <?php function getFlash($name) { return Yii::app()->user->getFlash($name); } $jsFunc = "show_stack_topleft('%s','%s' ,'%s' );"; if (Yii::app()->user->hasFlash(FlashMsg::SUCCESS)) { echo sprintf($jsFunc, 'success', FlashMsg::SUCCESS_TITLE, getFlash(FlashMsg::SUCCESS)); } if (Yii::app()->user->hasFlash(FlashMsg::ERROR)) { echo sprintf($jsFunc, 'error', FlashMsg::ERROR_TITLE, getFlash(FlashMsg::ERROR)); } if (Yii::app()->user->hasFlash(FlashMsg::WARNING)) { echo sprintf($jsFunc, 'notice', FlashMsg::WARNING_TITLE, getFlash(FlashMsg::WARNING)); } if (Yii::app()->user->hasFlash(FlashMsg::INFO)) { echo sprintf($jsFunc, 'info', FlashMsg::INFO_TITLE, getFlash(FlashMsg::INFO)); } ?> }); </script> </html>
getClass('/employee/add'); ?> "><a href="/employee/add"> Add Employee </a></li> <li class="<?php getClass('/salaries'); ?> "><a href="/salaries">Salary List</a></li> </ul> </div><!--/.nav-collapse --> </div> </nav> <div class="container"> <?php if (getFlash()) { getMessage(getFlash(), 'success'); setFlash(''); } ?> {{{=yields_contents=}}} </div> <script src="../../../assets/js/jquery.js"></script> <?php javaScripts('js'); ?> <style> body { padding-top: 70px; }
<div class="alert alert-<?php echo $type; ?> "> <?php echo getFlash($key); ?> </div>
$link = htmlspecialchars(trim($_POST['link'])); $describe = clean_html($_POST['describe']); if (!preg_match("/^http\\:\\/\\/.{4,300}\$/i", $link) || !$link) { dsetcookie('setok', 'home4'); header("location: {$webaddr}/{$my['user_name']}/profile"); exit; } elseif (StrLenW($describe) > 100) { dsetcookie('setok', 'home5'); header("location: {$webaddr}/{$my['user_name']}/profile"); exit; } else { // 判断是否视频 $parseLink = parse_url($link); $suffix = mediasuffix($link); if (preg_match("/(tudou.com|youku.com|ku6.com)\$/i", strtolower($parseLink['host']), $hosts) && $suffix != "swf") { $flashvar = getFlash($link, strtolower($hosts[1])); if (!empty($flashvar)) { $type = 'video'; $htmls = getVideoHtml($link, strtolower($hosts[1])); $videotitle = $htmls[0]; $videopic = $htmls[1]; } } else { if (in_array($suffix, array("mp3", "wma"))) { $type = 'music'; } else { if ($suffix == 'swf') { $type = 'flash'; } else { $type = 'website'; }
?> ><a href="index.php?module=utilisateur&action=connexion">SE CONNECTER</a></li> <?php } ?> </ul> </div> <div class="clearfix"></div> </nav> <div id="body"> <div id="flashbag"> <?php //Affichage des Notifications $flash = getFlash(); if (!empty($flash)) { foreach ($flash as $type => $tabFlashs) { foreach ($tabFlashs as $flash) { ?> <div class="alert alert-<?php echo $type; ?> "> <?php echo $flash; ?> </div> <?php } }
<?php echo form_input('password_compare'); ?> <?php echo form_error('password_compare'); ?> </div> <button type="submit" class="btn btn-success">Зареэструвати</button> </form> <?php } else { ?> <div class="alert alert-success" role="alert"> <?php echo getFlash('sucess'); ?> </div> <?php } ?> </div> </div> </div> </div> </div> </div> </div> </div>