#26 2014-02-11 18:24:10

SamerLP
Člen
Registrován: 2013-07-25
Příspěvky: 497

Re: [Vyřešeno] Errory

to radšej shianuť su tam dva subory 1:

<?php
/*
Plugin Name: Simple Ajax Shoutbox
Plugin URI: http://socialenemy.com/2009/06/simple-wordpress-ajax-shoutbox/
Description: This plugin will enable shoutbox into your sidebar widget. Using AJAX technology so visitor does'nt have to refresh each time they post messages into this shoutbox. It also has simple design, so it will definetely fit in your site, does'nt matter what your template is. See also: <a href="http://socialenemy.com/2009/06/simple-wordpress-ajax-shoutbox/">Information</a>.
Version: 1.2.3
Author: Indra Prasetya
Author URI: http://socialenemy.com/

Copyright 2009, Indra Prasetya

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

add_action('widgets_init', array('ajax_shoutbox', 'register'));
register_activation_hook( __FILE__, array('ajax_shoutbox', 'activate'));
register_deactivation_hook( __FILE__, array('ajax_shoutbox', 'deactivate'));
add_action('wp_head', array('ajax_shoutbox', 'style'));
add_action('plugins_loaded', array('ajax_shoutbox', 'load_library'));

if(!class_exists('ajax_shoutbox')){
	class ajax_shoutbox {
		function widget($args){
			extract($args);
			$options = get_option('widget_shoutbox');		
			$siteurl = get_option ('siteurl');
			$plugin_path = $siteurl . '/wp-content/plugins/simple-ajax-shoutbox/';
			
			echo $before_widget;
			echo $before_title . $options['title'] . $after_title;
			
			echo "<!-- Simple Ajax Shoutbox v1.2.3 by Indra http://socialenemy.com //-->\n";
			echo "<div id='sb_messages'>";
			echo "<noscript><div class='error_message' align='center'>" . __('Please enable javascript.') . "</div></noscript>";
			echo "<br/><center><img src='$siteurl/wp-content/plugins/simple-ajax-shoutbox/inc/loading.gif' alt='Loading' title='Loading'/></center>";			
			echo "<br/><center><a href='http://socialenemy.com/' target='_blank'><span style='text-decoration:none;'></span></a></center>";			
			echo "</div>\n";
			
			echo "<div id='input_area'>\n";
				echo "<table width='100%' border='0' cellspacing='1' cellpadding='0'>\n";
				if($options['registered_user'] == 'true' && !is_user_logged_in()){
					echo "<tr><td colspan='2' align='center'><div class='info'>" . __('Len registrovaný môžu prispievať') . "</div></td></tr>\n";
					echo "</table>\n";
				} else {
					if (is_user_logged_in()) {
						global $current_user;	get_currentuserinfo();
						echo "<input type='hidden' id='sb_name' value='" . $current_user->display_name . "'>\n";
						echo "<input type='hidden' id='sb_website' value='" . $current_user->user_url . "'>\n";
					} else {
						if($options['registered_user'] == 'true'){
							echo "<tr><td colspan='2'><div class='info'>" . __('Only registered user allowed.') . "</div></td></tr>\n";
						} else {
							echo "<tr><td colspan='2'><div class='info'>" . __('Name') . "</div><input id='sb_name' type='text' class='sb_input' maxlength='100'></td></tr>\n";
							echo "<tr><td colspan='2'><div class='info'>" . __('Website') . "</div><input id='sb_website' type='text' class='sb_input' maxlength='255'></td></tr>\n";
						}
					}
					echo "<tr><td colspan='2'>";
					echo "<div class='info'>" . __('Správa') . "</div><input id='sb_message' type='text' class='sb_input' maxlength='255'></td></tr>\n";
					echo "<tr><td><input type='submit' value='" . __('Odoslať') . "' id='sb_addmessage'> <span id='sb_status'></span></td>\n";
					echo "<td style='text-align:right;'>";
					if (get_option('use_smilies')) 
					  echo "<img src='$siteurl/wp-includes/images/smilies/icon_smile.gif' border='0' alt='Smile' title='"  .__('Smilies') . "' id='sb_showsmiles'>";
					echo "</td></tr>\n";
					echo "</table>\n";
				}
				
				echo "<div id='sb_smiles' align='center'>\n";
		
				if (get_option('use_smilies')) {
					$wpsmiliestrans = array (':mrgreen:' => 'icon_mrgreen.gif', ':neutral:' => 'icon_neutral.gif', ':twisted:' => 'icon_twisted.gif', ':arrow:' => 'icon_arrow.gif', ':shock:' => 'icon_eek.gif', ':smile:' => 'icon_smile.gif', ':???:' => 'icon_confused.gif', ':cool:' => 'icon_cool.gif', ':evil:' => 'icon_evil.gif', ':grin:' => 'icon_biggrin.gif', ':idea:' => 'icon_idea.gif', ':oops:' => 'icon_redface.gif', ':razz:' => 'icon_razz.gif', ':roll:' => 'icon_rolleyes.gif', ':wink:' => 'icon_wink.gif', ':cry:' => 'icon_cry.gif', ':eek:' => 'icon_surprised.gif', ':lol:' => 'icon_lol.gif', ':mad:' => 'icon_mad.gif', ':sad:' => 'icon_sad.gif', '8-)' => 'icon_cool.gif', '8-O' => 'icon_eek.gif', ':-(' => 'icon_sad.gif', ':-)' => 'icon_smile.gif', ':-?' => 'icon_confused.gif', ':-D' => 'icon_biggrin.gif', ':-P' => 'icon_razz.gif', ':-o' => 'icon_surprised.gif', ':-x' => 'icon_mad.gif', ':-|' => 'icon_neutral.gif', ';-)' => 'icon_wink.gif', '8)' => 'icon_cool.gif', '8O' => 'icon_eek.gif', ':(' => 'icon_sad.gif', ':)' => 'icon_smile.gif', ':?' => 'icon_confused.gif', ':D' => 'icon_biggrin.gif', ':P' => 'icon_razz.gif', ':o' => 'icon_surprised.gif', ':x' => 'icon_mad.gif', ':|' => 'icon_neutral.gif', ';)' => 'icon_wink.gif', ':!:' => 'icon_exclaim.gif', ':?:' => 'icon_question.gif' );
					foreach ((array)$wpsmiliestrans as $smiley => $img ) {
						$smiley_masked = attribute_escape(trim($smiley));
						echo "<img src='$siteurl/wp-includes/images/smilies/$img' alt='$smiley_masked' class='wp-smiley' style='padding:1px;cursor:pointer;' onclick=\"add_item(' $smiley_masked')\"/>";
					}
				}
				
				if($options['shoutbox_bl'] == 'true'){
					echo "<br/><center><a href='http://socialenemy.com/2009/06/simple-wordpress-ajax-shoutbox/' target='_blank'></a></center>";
				}
				echo "</div>\n";
			echo "</div>\n";
			echo "<!-- Simple Ajax Shoutbox v1.2.3 by Indra http://socialenemy.com //-->\n";
			
			echo $after_widget;
?>
			<script type="text/javascript">
				var plugin_path = "<?php echo $plugin_path; ?>";
				var reload_time = <?php echo $options['shoutbox_reload'];?>;
				jQuery(function($){sb_reload();$("div#sb_messages").mouseover(function(){$("div#input_area").show("slow");$("span#sb_status").html("")});$("input#sb_addmessage").click(function(){var b=$("input#sb_name").val();var c=$("input#sb_website").val();var d=$("input#sb_message").val();$("span#sb_status").html("Crunching...").show();$("input#sb_addmessage").attr("disabled","disabled");var e="&";$.ajax({type:"POST",url:plugin_path+"ajax_shoutbox_process.php",cache:false,data:"op=add"+e+"user="+b+e+"message="+d+e+"website="+c,success:function(a){$("div#sb_messages").prepend(a);$("div#sb_new_message").show("slow");$("input#sb_message").val("");$("input#sb_addmessage").removeAttr("disabled");$("span#sb_status").html("Thanks!").fadeOut("slow");$("div#input_area").hide("slow")},error:function(a){$("span#sb_status").html("Request error")}})});$("img#sb_showsmiles").click(function(){$("div#sb_smiles").fadeIn("slow")})});function add_item(a){var b=jQuery("input#sb_message").val()+a;jQuery("input#sb_message").val(b)}function sb_reload(){jQuery("div#sb_messages").load(plugin_path+"ajax_shoutbox_process.php?"+new Date().getTime());jQuery("span#sb_status").ajaxSend(function(a,b,c){jQuery(this).html("Musíš niečo najprv napísať.").show()});jQuery("div#sb_messages").ajaxError(function(a,b,c){jQuery(this).html("<div class='error_message' align='center'>Request error</div>");jQuery("span#sb_status").fadeOut("slow")});jQuery("span#sb_status").ajaxSuccess(function(a,b,c){jQuery(this).fadeOut("slow")});setTimeout("sb_reload()",reload_time*1000)}function delete_message(c){if(!confirm("Naozaj chceš túto správu vymazať?"))return false;var d="&";jQuery.ajax({type:"POST",url:plugin_path+"ajax_shoutbox_process.php",cache:false,data:"op=delete"+d+"m_id="+c,success:function(a,b){if(parseInt(a)>0)jQuery('div#sb_message_'+a).hide('slow');jQuery('input#sb_message').val('');jQuery('div#input_area').hide('slow')}})}
			</script>
<?php
		}
		
		function control() {
			$options = $newoptions = get_option('widget_shoutbox');
			if($_POST["shoutbox_submit"]) {
				$newoptions['title'] = strip_tags(stripslashes($_POST["shoutbox_title"]));
				if(empty($newoptions['title'])) $newoptions['title'] = 'Shoutbox';
				$newoptions['max_messages'] = strip_tags(stripslashes($_POST["max_messages"]));
				if(empty($newoptions['max_messages'])) $newoptions['max_messages'] = '20';
				$newoptions['flood_time'] = strip_tags(stripslashes($_POST["flood_time"]));
				if(empty($newoptions['flood_time'])) $newoptions['flood_time'] = '30';
				$newoptions['shoutbox_reload'] = strip_tags(stripslashes($_POST["shoutbox_reload"]));
				if(empty($newoptions['shoutbox_reload'])) $newoptions['shoutbox_reload'] = '30';
				$newoptions['shoutbox_bl'] = ($_POST["shoutbox_bl"] == 'true')? 'true' : 'false';
				$newoptions['allow_html'] = ($_POST["allow_html"] == 'true')? 'true' : 'false';
				$newoptions['check_spam'] = ($_POST["check_spam"] == 'true')? 'true' : 'false';
				$newoptions['registered_user'] = ($_POST["registered_user"] == 'true')? 'true' : 'false';
			}
			if ($options != $newoptions) {
				$options = $newoptions;
				update_option('widget_shoutbox', $options);
			}
			
			$title = htmlspecialchars($options['title'], ENT_QUOTES);
			$max_messages = $options['max_messages'];
			$flood_time = $options['flood_time'];
			$shoutbox_reload = $options['shoutbox_reload'];
			$shoutbox_bl = ($options['shoutbox_bl'] == 'true')? 'checked="checked"' : '';
			$allow_html = ($options['allow_html'] == 'true')? 'checked="checked"' : '';
			$check_spam = ($options['check_spam'] == 'true')? 'checked="checked"' : '';
			$registered_user = ($options['registered_user'] == 'true')? 'checked="checked"' : '';
?>
			<p><label for="shoutbox_title"><?php _e('Title:'); ?><br/><input	style="width: 250px;" id="shoutbox_title" name="shoutbox_title"	type="text" value="<?php echo $title; ?>" /></label></p>
			<p><label for="shoutbox_max_messages"><?php _e('Max messages in shoutbox:'); ?><br/><input style="width: 50px;" id="max_messages" name="max_messages" type="text" value="<?php echo $max_messages; ?>" /></label></p>
			<p><label for="shoutbox_flood"><?php _e('Flood time in seconds:'); ?><br/><input style="width: 50px;" id="shoutbox_flood" name="shoutbox_flood" type="text" value="<?php echo $flood_time; ?>" /></label></p>
			<p><label for="shoutbox_reload"><?php _e('Reload time in seconds:'); ?><br/><input style="width: 50px;" id="shoutbox_reload" name="shoutbox_reload" type="text" value="<?php echo $shoutbox_reload; ?>" /></label></p>
			<p><label for="shoutbox_registered"><?php _e('Only Registered User:'); ?><br/><input type="checkbox" id="registered_user" name="registered_user" type="text" value="true" <?php echo $registered_user;?> /> Only registered user allowed.</label></p>
			<p><label for="shoutbox_html"><?php _e('Allow HTML:'); ?><br/><input type="checkbox" id="allow_html" name="allow_html" type="text" value="true" <?php echo $allow_html;?> /> Disabling this will strip URL and malicious script.</label></p>
			<p><label for="shoutbox_spam"><?php _e('Check Spam:'); ?><br/><input type="checkbox" id="check_spam" name="check_spam" type="text" value="true" <?php echo $check_spam;?> /> Check using Akismet, may degrades process time.</label></p>
			<p><label for="shoutbox_bl"><?php _e('Add backlink:'); ?><br/><input type="checkbox" id="shoutbox_bl" name="shoutbox_bl" type="text" value="true" <?php echo $shoutbox_bl;?> /> You can disable this, but if you enable it, Thanks!</label></p>
			<input type="hidden" id="shoutbox_submit" name="shoutbox_submit" value="1" />
<?php
		}
			
		function style() {
?>
			<style type="text/css">
				.error_message{margin-bottom:4px; padding:3px; border:1px solid #B36462; color:#B36462; background-color:#EEDBDB;}				
				.sb_input{width:100%; margin:2px 0;}
				#sb_smiles{margin-top:4px; display:none;}
				#sb_messages{padding:2px; overflow:auto; height:250px;text-align:left;}
				#sb_showsmiles{cursor:pointer;}
				#input_area{display:none;text-align:left;}
			</style>
<?php
		}
		
		function activate(){
			global $wpdb;
			$table_name = $wpdb->prefix . "messagebox";
			if($wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name) {
				$table_name = $wpdb->prefix . "messagebox";
				$sql = "CREATE TABLE IF NOT EXISTS " . $table_name . " (
				  id int(10) NOT NULL auto_increment,
				  user_login varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL default '',
				  website varchar(255) COLLATE latin1_general_ci NOT NULL default '',
				  post_date datetime NOT NULL default '0000-00-00 00:00:00',
				  message text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
				  status tinyint(1) NOT NULL default '0',
				  ip varchar(15) COLLATE latin1_general_ci NOT NULL default '',
				  PRIMARY KEY  (`id`)
				);";
				require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
				dbDelta($sql);
			}
			//initial values
			$data = array( 'title' => 'Shoutbox', 'max_messages' => '20', 'flood_time' => '30', 'shoutbox_reload' => '30', 'shoutbox_bl' => 'true', 'allow_html' => 'false', 'check_spam' => 'true', 'registered_user' => 'false');
	    if (!get_option('widget_shoutbox')){
	      add_option('widget_shoutbox', $data);
	    } else {
	      update_option('widget_shoutbox', $data);
	    }		
		}
		
		function deactivate(){
			global $wpdb;
			$table_name = $wpdb->prefix . "messagebox";
			$wpdb->query("DROP TABLE " . $table_name);
			delete_option('widget_shoutbox');
		}
		
		function load_library() {
			wp_enqueue_script('jquery');
		}
		
		function register(){
			register_sidebar_widget('Shoutbox', array('ajax_shoutbox', 'widget'));
			register_widget_control('Shoutbox', array('ajax_shoutbox', 'control'));
		}
	}
}
?>

2)

<?php
$httphost = @$_SERVER ['HTTP_HOST'];
$httpreferer = @$_SERVER ['HTTP_REFERER'];
$nonce = $_POST ['nonce'];
require_once '../../../wp-config.php';
require (ABSPATH . WPINC . '/registration.php');

function spam_check($request, $host, $path, $port = 80) {	
	$http_request = "POST $path HTTP/1.0\r\n";
	$http_request .= "Host: $host\r\n";
	$http_request .= "Content-Type: application/x-www-form-urlencoded; charset=" . get_settings ( 'blog_charset' ) . "\r\n";
	$http_request .= "Content-Length: " . strlen ( $request ) . "\r\n";
	$http_request .= "User-Agent: WordPress/$wp_version | Akismet/1.11\r\n";
	$http_request .= "\r\n";
	$http_request .= $request;
	
	$response = '';
	if (false !== ($fs = @fsockopen ( $host, $port, $errno, $errstr, 3 ))) {
		@fwrite ( $fs, $http_request );
		while ( ! feof ( $fs ) )
			$response .= @fgets ( $fs, 1160 );
		fclose ( $fs );
		$response = explode ( "\r\n\r\n", $response, 2 );
	}
	return $response;
}

if (! eregi ( $httphost, $httpreferer ) or empty ( $httpreferer )) {
	echo "<div class='error_message' align='center'>" . __ ( 'Unknown referrer.' ) . "</div>";
	exit ();
} else {
	@header ( 'Content-Type: text/html; charset=' . get_option ( 'blog_charset' ) );
	global $wpdb;
	$options = get_option ( 'widget_shoutbox' );
	$siteurl = get_option ( 'siteurl' );
	$table_name = $wpdb->prefix . "messagebox";
	switch ($_POST ['op']) {
		case "add" :
			if (is_user_logged_in ()) {
				global $current_user;
				get_currentuserinfo ();
				$user = $current_user->display_name;
				$website = $current_user->user_url;
				$proceed = true;
			} else if($options['registered_user'] == 'true'){
				echo "<div class='error_message' align='center'>" . __ ( 'Len registrovaný môžu prispievať.' ) . "</div>";
				$proceed = false;
			} else if ( isset ( $_POST ['user'] ) ) {
				if (username_exists ( trim ( $_POST ['user'] ) )) {
					echo "<div class='error_message' align='center'>" . __ ( 'Name already exists, please choose another.' ) . "</div>";
					$proceed = false;
				} elseif (strlen ( $_POST ['user'] ) == 0) {
					echo "<div class='error_message' align='center'><b>" . __ ( 'Name empty.' ) . "</b></div>";
					$proceed = false;
				} else {
					$user = $wpdb->escape ( trim ( strip_tags ( $_POST ['user'] ) ) );
					$website = $wpdb->escape ( attribute_escape ( clean_url ( $_POST ['website'] ) ) );
					$proceed = true;
				}
			} else {
				if (! @validate ( $_POST ['user'] )) {
					echo "<div class='error_message' align='center'>" . __ ( 'Name empty.' ) . "</div>";
					$proceed = false;
				} else {
					$proceed = true;		
				}
			}
			
			$message = $wpdb->escape ( $_POST ['message'] );	
			
			if (strlen ( $message ) == 0) {
				echo "<div class='error_message' align='center'><b>" . __ ( 'Správa prázdna.' ) . "</b></div>";
				$proceed = false;
			}
			
			$key = get_option ( 'wordpress_api_key' );
			if ($options ['check_spam'] == 'true' && ! empty ( $key )) {
				$akismet_api_host = $key . '.rest.akismet.com';
				
				$comment ['user_ip'] = preg_replace ( '/[^0-9., ]/', '', $_SERVER ['REMOTE_ADDR'] );
				$comment ['user_agent'] = $_SERVER ['HTTP_USER_AGENT'];
				$comment ['referrer'] = $httpreferer;
				$comment ['blog'] = get_option ( 'home' );
				$comment ['comment_author'] = $user;
				$comment ['comment_author_url'] = 'http://' . preg_replace ( '/^http[s]?:\/\//i', '', $website );
				$comment ['comment_content'] = $message;
				
				$ignore = array ('HTTP_COOKIE' );
				
				foreach ( $_SERVER as $key => $value )
					if (! in_array ( $key, $ignore ))
						$comment ["$key"] = $value;
				
				$query_string = '';
				foreach ( $comment as $key => $data )
					$query_string .= $key . '=' . urlencode ( stripslashes ( $data ) ) . '&';
				$response = spam_check ( $query_string, $akismet_api_host, '/1.1/comment-check', 80 );
				
				if ('true' == $response [1]) {
					echo "<div class='error_message' align='center'><b>" . __ ( 'Blocked by Akismet.' ) . "</b></div>";
					$proceed = false;
				}
			}
						
			if ($proceed) {
				$tzNOW = current_time ( 'mysql' );
				
				if ($wpdb->get_var ( "SELECT count(*) FROM " . $table_name . " WHERE ip='" . @$_SERVER ['REMOTE_ADDR'] . "' AND (post_date + INTERVAL " . $options ['flood_time'] . " SECOND) > '$tzNOW'" ) > 1) {
					echo "<div class='error_message' align='center'>" . __ ( 'Please try again after a few seconds.' ) . "</div>";
				} else {
					if($wpdb->query ( "INSERT INTO " . $table_name . " (id,user_login,website,post_date,message,status,ip) VALUES (null,'$user','$website','$tzNOW','$message','1','" . @$_SERVER ['REMOTE_ADDR'] . "')" )){
						$row = $wpdb->get_row ( "SELECT *,DATE_FORMAT(post_date,'%H:%i') as post_date FROM " . $table_name . " ORDER BY id DESC LIMIT 1" );
						$m_id = intval ( $row->id );
						$m_user = ($options ['allow_html'] == 'true') ? $row->user_login : htmlspecialchars ( strip_tags ( $row->user_login ) );
						$m_date = $row->post_date;
						$m_text = stripslashes (convert_smilies ( (($options ['allow_html'] == 'true') ? $row->message : htmlspecialchars ( strip_tags ( $row->message ) ) ) ) );
						$m_ip = $row->ip;
						$m_website = preg_replace ( '/^http[s]?:\/\//i', '', $row->website );
						
						$m_user = (! empty ( $m_website )) ? "<a href='http://$m_website' title='$m_user' rel='external nofollow'>$m_user</a>" : $m_user;
						$can_moderate = (function_exists ( 'current_user_can' ) && current_user_can ( 'moderate_comments' )) ? true : false;
						
						echo "<div style='margin-bottom:4px;display:none;' id='sb_new_message'>\n";
						echo "<div><b>$m_user</b> <img src='$siteurl/wp-content/plugins/simple-ajax-shoutbox/inc/comment.png' border='0' style='padding:0px;' alt='Comment' ";
						if ($can_moderate) {
							echo "title='" . __ ( 'IP address' ) . ': ' . $m_ip . "'";
						}
						echo "/> <span class='info'>$m_date</span> ";
						if ($can_moderate) {
							echo " <a href='#delete' onclick=\"delete_message('$m_id')\" rel='$m_id'>[vymazať]</a>";
						}
						echo "</div>";
						echo "<div class='small'>$m_text</div>\n";
						echo "</div>\n";
					} else {
						echo "<div class='error_message' align='center'><b>" . __ ( 'Database insert failure. Try reinstall plugin.' ) . "</b></div>";
					}
				}
			}
			
			break;
		case 'delete' :
			if (is_user_logged_in ()) {
				if (function_exists ( 'current_user_can' ) && current_user_can ( 'moderate_comments' )) {
					$m_id = intval ( $_POST ['m_id'] );
					$wpdb->query ( "DELETE FROM " . $table_name . " WHERE id = '$m_id'" );
					echo $m_id;
					break;
				} 			
//				else {
//					$deleted = false;
//				}
//			} else {
//				$deleted = false;
//			}
//			
//			if ($deleted == true) {
//				echo $m_id;
//			} else {
//				echo '0';
			}
			echo '0';
			break;
		default :
			if ($result = $wpdb->get_results ( "SELECT *,DATE_FORMAT(post_date,'%H:%i') as post_date FROM " . $table_name . " ORDER BY id DESC LIMIT " . $options ['max_messages'] )) {
				$can_moderate = (function_exists ( 'current_user_can' ) && current_user_can ( 'moderate_comments' )) ? true : false;
				foreach ( $result as $row ) {
					$m_id = intval ( $row->id );
					$m_user = ($options ['allow_html'] == 'true') ? $row->user_login : htmlspecialchars ( strip_tags ( $row->user_login ) );
					$m_date = $row->post_date;
					$m_text = stripslashes (convert_smilies ( (($options ['allow_html'] == 'true') ? $row->message : htmlspecialchars ( strip_tags ( $row->message ) ) ) ) );
					$m_ip = $row->ip;
					$m_website = preg_replace ( '/^http[s]?:\/\//i', '', $row->website );
					
					$m_user = (! empty ( $m_website )) ? "<a href='http://$m_website' title='$m_user' rel='external nofollow'>$m_user</a>" : $m_user;					
					
					echo "<div style='margin-bottom:4px;' id='sb_message_$m_id'>\n";
					echo "<div><b>$m_user</b> <img src='$siteurl/wp-content/plugins/simple-ajax-shoutbox/inc/comment.png' border='0' style='padding:0px;' alt='Comment' ";
					if ($can_moderate) {
						echo "title='" . __ ( 'IP address' ) . ': ' . $m_ip . "'";
					}
					echo "/> <span class='info'>$m_date</span> ";
					if ($can_moderate) {
						echo " <a href='#delete' onclick=\"delete_message('$m_id')\" rel='$m_id'>[odstrániť]</a>";
					}
					echo "</div>";
					echo "<div class='small'>$m_text</div>\n";
					echo "</div>\n";
				}
			} else {
				echo "<div align='center'><b>" . __ ( 'No message.' ) . "</b></div>";
			}
			break;
	}
}
die ();
?>

Offline

#27 2014-02-11 18:31:35

Destroyer
Endora rádce
Registrován: 2009-11-01
Příspěvky: 2,097
Web

Re: [Vyřešeno] Errory

spis jiny shoutbox, tento porusuje podminky endory...

Offline

#28 2014-02-11 18:41:52

SamerLP
Člen
Registrován: 2013-07-25
Příspěvky: 497

Re: [Vyřešeno] Errory

čo? to odkedy čo porušuje? a jaký teda použiť ja použijem ale jaký? ja chcem takýto sad

Offline

#29 2014-02-11 19:31:54

Destroyer
Endora rádce
Registrován: 2009-11-01
Příspěvky: 2,097
Web

Re: [Vyřešeno] Errory

odjakziva je na endore zakazan chat s refreshem (ajax chat)

Offline

#30 2014-02-11 19:32:06

Trade
Endora rádce
Místo: Česká republika
Registrován: 2013-01-22
Příspěvky: 3,596
Web

Re: [Vyřešeno] Errory

Ajax chat je zakázán. Chat, který nemá funkci automatické aktualizace můžete použít, případně nějaký externí.


Kontaktujte nás | FAQ
Email: fk@endora.cz

Offline

#31 2014-02-11 19:57:16

SamerLP
Člen
Registrován: 2013-07-25
Příspěvky: 497

Re: [Vyřešeno] Errory

Aha tak asi aj preto sa mi pomali načítava web sad a poradíte nejaký? sad

Offline

#32 2014-02-11 20:02:51

Trade
Endora rádce
Místo: Česká republika
Registrován: 2013-01-22
Příspěvky: 3,596
Web

Re: [Vyřešeno] Errory


Kontaktujte nás | FAQ
Email: fk@endora.cz

Offline

#33 2014-02-11 20:57:00

SamerLP
Člen
Registrován: 2013-07-25
Příspěvky: 497

Re: [Vyřešeno] Errory

Skúsim ten Externí díky ale ešte potrebujem vyriešiť tie errory čo ostali sad
http://validator.w3.org/check?uri=http% … 2Fservices

Offline

#34 2014-02-11 21:35:34

zato
Endora uživatel
Registrován: 2010-12-10
Příspěvky: 37

Re: [Vyřešeno] Errory

Error Line 275, Column 153: The frameborder attribute on the iframe element is obsolete. Use CSS instead. <iframe frameborder="0" scrolling="no" width="200" height="400" src="http://miniaplikace.blueboard.cz/shoutboard.php?hid=93tfh2bfjhckb3sbp1773axk1r7m5t"> - iframe používá zastaralý atribut frameborder = smaž ho z toho iframe
Error Line 275, Column 153: The scrolling attribute on the iframe element is obsolete. Use CSS instead. <iframe frameborder="0" scrolling="no" width="200" height="400" src="http://miniaplikace.blueboard.cz/shoutboard.php?hid=93tfh2bfjhckb3sbp1773axk1r7m5t"> - iframe používá zastaralý atribut scrolling = smaž ho z toho iframe
Error Line 308, Column 84: Duplicate ID user_login. - <input id='user_login' type='text' name='log' required='required' /> pořád ten samý error - v kódu máš dvakrát id se stejnm názvem. Buď použíj class nebo to smaž id='user_login' - je to v loginu

Upravil kksmirice (2014-02-11 21:40:12)

Offline

#35 2014-02-12 16:00:25

SamerLP
Člen
Registrován: 2013-07-25
Příspěvky: 497

Re: [Vyřešeno] Errory

vyhodili sa nejaké dalšie errory a ešte neviem kde to spraviť to user_login nechápem lebo to je potom vadný plugin nevalidný!

<?php
/*
Plugin Name: Nice Login Widget
Plugin URI: http://www.superplug.in
Description: Add, build and manage login-register widget
Version: 1.3.8
Author: SuperPlugin Team
Author URI: http://superplug.in/team/
*/

add_action('init',  array('SP_Nice_Login_Widget', 'init'));
//add_action('widgets_init', create_function('', 'register_widget( "Pw_Login_Widget" );'));
add_action('widgets_init', array('SP_Nice_Login_Widget', 'widgets_init'));
register_activation_hook(__FILE__, array('SP_Nice_Login_Widget', 'activate') );

class SP_Nice_Login_Widget
{
	
	
	//consts
	
	const PLUGIN_VERSION =	'1.3.8';
	const ADMIN_STYLE_VERSION = "1.1.2";
	const PLUGIN_SCRIPT_VERSION = "1.3";
	
	public static function widgets_init(){
		
		register_widget( "Pw_Login_Widget" );

		$args = array(
				'name'          => 'Nice Login Widget Shortcode',
				'id'            => 'sp_login_shortcode',
				'description'   => __( "This sidebar does not act as a normal sidebar. It is a stand-in used to make the shortcode for Nice Login Widget available. Just drag the Nice Login Widget into the sidebar, then you can use the [sp_login_shortcode] shortcode in any page or post.", 'pwLogWi' ),
				'class'         => 'sp-shortcode-sidebar',
				'before_widget' => '<div id="%1$s" class="widget %2$s" style="display: inline-block">',
				'after_widget'  => '</div>',
				'before_title'  => '<h3 class="widget-title">',
				'after_title'   => '</h3>'
				);
		
		$sidebar_id = register_sidebar($args);
		
	}
	
	
	public static function init(){
		
		wp_register_style('pwLogWi_style', plugins_url('css/pw-login-widget.css' , __FILE__), null, self::ADMIN_STYLE_VERSION);
		wp_register_script( 'pwLogWi_script', plugins_url('js/pw-login-widget.js', __FILE__), array("jquery"), self::PLUGIN_SCRIPT_VERSION);
		
		wp_register_script( 'pwLogWi_ajax_authentication', plugins_url('js/ajax-authentication.js', __FILE__), array("jquery"), self::PLUGIN_SCRIPT_VERSION);
		
		
		load_plugin_textdomain("pwLogWi", false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
		
		add_shortcode( 'sp_login_shortcode', array( 'SP_Nice_Login_Widget', 'sp_login_shortcode' ) );
		
		if (is_admin()){
			
			if ( !defined('DOING_AJAX') || !DOING_AJAX )
				self::check_redirect_to_nlwteaser();
			
			add_action( 'admin_menu', array( 'SP_Nice_Login_Widget', 'admin_menus') );
			
			add_action('admin_enqueue_scripts', array('SP_Nice_Login_Widget', 'admin_enqueue_scripts') , 10 , 1);
			
			add_action('wp_ajax_nopriv_login', array('SP_Nice_Login_Widget', 'ajax_authenticate_users'));
			add_action('wp_ajax_login', array('SP_Nice_Login_Widget', 'ajax_authenticate_users'));
			add_action('wp_ajax_nopriv_register', array('SP_Nice_Login_Widget', 'ajax_authenticate_users'));
			add_action('wp_ajax_nopriv_lostpassword', array('SP_Nice_Login_Widget', 'ajax_authenticate_users'));
			
		}else{
			
			
			add_action( 'wp_enqueue_scripts', array('SP_Nice_Login_Widget', 'enqueue_scripts' ));
			
		}
		
		
	}
	
	public static function check_redirect_to_nlwteaser(){

		//If network do it only in network admin pages
		if ( is_multisite() && !is_network_admin() )		return;
		
		if ( get_transient('nlw_teaser_page_redirect') || get_option('nlw_version')!=self::PLUGIN_VERSION ){
			if( get_option('nlw_version') != self::PLUGIN_VERSION ){
				set_transient( 'nlw_teaser_page_redirect', 1, 60*60);
				update_option('nlw_version', self::PLUGIN_VERSION);
			}
			$location = admin_url( 'index.php?page=nice-login-register-widget/nlw-about.php' ) ;
			wp_safe_redirect($location);
		}
	}
	
	public static function admin_menus(){

		// About
		$dashboard_page_title = __('Upgrade To Login Widegt Pro', 'pwLogWi') ;
		$about = add_dashboard_page( $dashboard_page_title , '', 'manage_options', 'nice-login-register-widget/nlw-about.php', '' );
		
	}
	
	public static function activate(){
		
		if ( is_multisite() && !is_network_admin() )		return;
		
		//LWP teaser page
		set_transient( 'nlw_teaser_page_redirect', 1, 60*60);
		
	}
	
	public static function sp_login_shortcode(){
		ob_start();
		?><div class="nlw-shortcode-wrapper"><?php
		dynamic_sidebar('sp_login_shortcode');
		?></div><!-- .nlw-shortcode-wrapper --><?php
		return ob_get_clean();
	}
	
	public static function ajax_authenticate_users(){
		
		
		
		check_ajax_referer('sp-security-nonce', 'security');
		
		if (isset($_POST['action'])){
			require_once 'ajax-authenticate-users.php';
			$response = Ajax_Auth_users::authenticate_users($_POST['action']);
			echo json_encode($response);
		}
		die();
	}

	
	public static function admin_enqueue_scripts($hook){
		if ($hook=='widgets.php' || strstr($hook, 'sp_nice_login_widget')){
			wp_enqueue_style('pwLogWi_style' );
			wp_enqueue_script( 'pwLogWi_script' );
		}
	}
	
	
	public static function enqueue_scripts(){
		wp_enqueue_style('pwLogWi_style' );
		wp_enqueue_script( 'pwLogWi_script' );

		wp_enqueue_script( 'pwLogWi_ajax_authentication' );
		
		wp_localize_script('pwLogWi_script', 'ajax_object', array('ajax_url' => admin_url( 'admin-ajax.php' )));
	
	}
	
	
	
}



class Pw_Login_Widget extends WP_Widget
{
	
	
	/**
	 * The class constructor
	 *
	 * This setup the class and generate
	 *
	 *
	 */
	public function __construct() {
	
		$widget_options = array();
		$control_options = array();
		parent::__construct(
				'pw_login_widget',
				'Nice Login/Register Widget',
				array('description' => __('Add, build and manage login-register widget', 'pwLogWi'))
		);
	
	}

	/**
	 * Back-end widget form.
	 *
	 * @see WP_Widget::form()
	 *
	 * @param array $instance Previously saved values from database.
	 *
	 */
	public function form( $instance ) {
	
		if ( !empty( $instance[ 'border' ] ) ) {
			$border = "checked = 'checked'";
		}
		if ( !empty( $instance[ 'border_color' ] ) ) {
			$border_color = $instance[ 'border_color' ];
		}
		if (empty($border_color)){
			$border_color = '#000000';
		}
		
		if ( !empty( $instance[ 'include_remember_me' ] ) ) {
			$checked = "checked";
		}
		if (!empty( $instance[ 'ajax_authentication' ] )){
			$ajax_auth = "checked";
		}
		if ( isset( $instance[ 'logged_in_text' ] ) ) {
			$logged_in_text = $instance[ 'logged_in_text' ];
		}
		
		if ( !empty( $instance[ 'default_form' ] )){
			if ($instance[ 'default_form' ]=='login_form'){
				$login_form = "selected";
			}else if ($instance[ 'default_form' ]=='register_form'){
				$register_form = "selected";
			}
		}
		
		if ( isset( $instance[ 'float' ] ) && $instance[ 'float' ]=='horizontal'){
			$horizontal = "selected";
		}else{
			$vertical = "selected";
		}
		
		if (isset($instance['css_class'])){
			$css_class = $instance['css_class'];
		}else{
			$css_class = "";
		}
		add_thickbox();
		?>
			<h3><?php _e('Widget Options', 'pwLogWi')?></h3>
			<p>  
    		<label for="<?php echo $this->get_field_id( 'title' ); ?>"><strong><?php _e('Title:', 'pwLogWi'); ?></strong></label>  
    		<input type="text" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" style="width:100%;" />
			</p>
			<p><input type="checkbox" id="<?php echo $this->get_field_id('title_only_loggedout')?>" name="<?php echo $this->get_field_name('title_only_loggedout')?>" <?php checked('yes', $instance['title_only_loggedout'])?> />
			<label for="<?php echo $this->get_field_id('title_only_loggedout')?>"><?php _e('Show title only in logged-out mode', 'pwLogWi') ?></label></p>
			<p><label for="<?php echo $this->get_field_id("css_class"); ?>"><strong><?php _e('CSS class name: ', 'pwLogWi') ?></strong></label>
			<input type="text" id="<?php echo $this->get_field_id("css_class"); ?>" name="<?php echo $this->get_field_name("css_class"); ?>" value="<?php echo $css_class; ?>" >
			</p>
			<div class="sp-widget-back-end-div">
			<ul class="sp-tabs-menu">
			<li class="sp-active" style="border-right: 1px solid #dfdfdf ;"><span class="sp_switch_logged_out" ><strong><?php _e('Logged Out', 'pwLogWi') ?></strong></span></li>
			<li class=""><span class="sp_switch_logged_in" ><strong><?php _e('Logged In', 'pwLogWi') ?></strong></span></li>
			</ul>
			<div class="sp-options-content">
			
			<div  >
			<ul>
			<li>
			<label for="<?php echo $this->get_field_id('default_form'); ?>" ><strong><?php _e('Default Form: ', 'pwLogWi') ?></strong></label>
			<select id="<?php echo $this->get_field_id("default_form"); ?>" name="<?php echo $this->get_field_name("default_form"); ?>" >
			<option value="login_form" <?php echo $login_form; ?>><?php _e('Login Form', 'pwLogWi') ?></option>
			<option value="register_form" <?php echo $register_form; ?>><?php _e('Register Form', 'pwLogWi') ?></option>
			</select>
			</li>
			<li>
			<label for="<?php echo $this->get_field_id('float'); ?>" ><strong><?php _e('Float: ', 'pwLogWi') ?></strong></label>
			<select id="<?php echo $this->get_field_id("float"); ?>" name="<?php echo $this->get_field_name("float"); ?>" >
			<option value="horizontal" <?php echo $horizontal; ?>><?php _e('Horizontal', 'pwLogWi') ?></option>
			<option value="vertical" <?php echo $vertical; ?>><?php _e('Vertical', 'pwLogWi') ?></option>
			</select>
			</li>
			<li><input type="checkbox" id="<?php echo $this->get_field_id( 'include_remember_me' ); ?>" title="Include Remember-me"  name="<?php echo $this->get_field_name( 'include_remember_me' ); ?>" <?php echo $checked; ?> />
			<label for="<?php echo $this->get_field_id( 'include_remember_me' ); ?>" >	<strong><?php _e('Include "Remember-Me"', 'pwLogWi') ?></strong></label>
				<p style="margin-left: 10px; <?php if (empty($checked)) echo 'display:none;"';?>" >
				<label><input type="radio" name="<?php echo $this->get_field_name("remember_me_def"); ?>" value="uncheck_by_default" <?php if ($instance['remember_me_def']=='uncheck_by_default') echo "checked='checked'"; ?>><?php _e('Uncheck by default ', 'pwLogWi') ?></label> <br>
				<label><input type="radio" name="<?php echo $this->get_field_name("remember_me_def"); ?>" value="check_by_default" <?php if ($instance['remember_me_def']=='check_by_default') echo "checked='checked'";?>><?php _e('Check by default ', 'pwLogWi') ?></label> 
				</p> 
			</li>
			
			<li>
			<label><input type="radio" name="<?php echo $this->get_field_name( 'ajax_authentication' ); ?>" value="1" <?php if (!empty($ajax_auth)) echo "checked='checked'";?>><strong><?php _e('Ajax Authentication', 'pwLogWi') ?></strong></label><br>
			<label><input type="radio" name="<?php echo $this->get_field_name( 'ajax_authentication' ); ?>" value="0" <?php if (empty($ajax_auth)) echo "checked='checked'";?>><strong><?php _e('Regular WP Authentication', 'pwLogWi') ?></strong></label>
			</li>
			<li>
				<input type="checkbox" id="<?php echo $this->get_field_id("border") ?>" name="<?php echo $this->get_field_name("border") ?>" title="<?php _e("Add widget border", "pwLogWi") ?>" <?php echo $border?>>
				<label for="<?php echo $this->get_field_id("border") ?>"><strong> <?php _e("Widget Border", "pwLogWi") ?></strong></label>
				<p style="margin-left: 10px; <?php if (empty($border)) echo "display:none;";?>">
				<label><?php _e("Enter border color", "pwLogWi")?><br>
				<?php global $is_opera, $is_chrome; ?>
				<input type="<?php echo ($is_opera || $is_chrome) ? "color" : "text" ; ?>" id="<?php echo $this->get_field_id("border_color") ?>" name="<?php echo $this->get_field_name("border_color") ?>" value="<?php echo $border_color; ?>">
				</label>
				</p>
			</li>
			</ul>
			</div>
			
			<div  style="display:none;">
			<strong><?php _e('Add Logged-In message', 'pwLogWi') ?></strong><br>
			<select class="merge-tags-select"><?php self::print_merge_tags_options(); ?> </select>
			<textarea rows="" cols="" id="<?php echo $this->get_field_id("logged_in_text"); ?>" name="<?php echo $this->get_field_name("logged_in_text"); ?>" style="width: 210px;height: 100px;"><?php echo $logged_in_text; ?></textarea>
			</div>
			</div>
			
			</div>
			<div class="lwp-banner" style="text-align: center;border: 1px #DFDFDF solid;border-radius: 4px;padding: 4px;margin: 4px 0 15px;">
			<a href="http://superplug.in/product/login-widget-pro/?utm_source=nice_login_widget__inSidebars_links&utm_medium=banner&utm_campaign=Nice+Login+Widget" target="_blank">
			<img src="<?php echo plugins_url("images/Banner.jpg", __FILE__) ?>" title="Login Widget Pro" style="width: 100%;max-width: 226px;height: auto;"></a>
			</div>
			<?php 
			wp_nonce_field(plugin_basename( __FILE__ ), 'pwLogWi_noncename');
			
		}
		
		static function print_merge_tags_options(){
			
			echo "<option value=''>" . __('Insert Merge Tag', 'pwLogWi') . "</option>";
			echo "<option value='display_name'>" . __('User display name', 'pwLogWi') . "</option>";
			echo "<option value='user_nicename'>" . __('User nice name', 'pwLogWi') . "</option>";
			echo "<option value='user_login'>" . __('User login', 'pwLogWi') . "</option>";
			echo "<option value='user_email'>" . __('User email', 'pwLogWi') . "</option>";
			echo "<option value='logout_link'>" . __('Log-out link', 'pwLogWi') . "</option>";
			echo "<option value='profile_link'>" . __('Profile link', 'pwLogWi') . "</option>";
			
		}
		
		/**
		 * Sanitize widget form values as they are saved.
		 *
		 * @see WP_Widget::update()
		 *
		 * @param array $new_instance Values just sent to be saved.
		 * @param array $old_instance Previously saved values from database.
		 *
		 * @return array Updated safe values to be saved.
		 */
		public function update( $new_instance, $old_instance ) {

		
			if (wp_verify_nonce($_POST['pwLogWi_noncename'], plugin_basename( __FILE__ ))){
				
				$instance = array();
				$instance['title'] = strip_tags( $new_instance['title'] );
				$instance['title_only_loggedout'] = empty($new_instance['title_only_loggedout']) ? 'no' : 'yes' ;
				$instance['css_class'] = strip_tags( $new_instance['css_class'] );
				$instance['include_remember_me'] = strip_tags( $new_instance['include_remember_me'] );
				$instance['default_form'] = strip_tags($new_instance['default_form']);
				$instance['float'] = strip_tags($new_instance['float']);
				$instance['logged_in_text'] = $new_instance['logged_in_text'];
				$instance['remember_me_def'] = $new_instance['remember_me_def'];
				$instance['ajax_authentication'] = $new_instance['ajax_authentication'];
				$instance['border'] = $new_instance['border']; 
				$instance['border_color'] = $new_instance['border_color'];
			
				return $instance;
			}
			
			return $old_instance;
		
		}
		
		static function interapt_merge_tags($input_text, $redirect_url){
			
			$return_text = $input_text;
			$user = wp_get_current_user();
			$user_data = get_object_vars($user->data);
			preg_match_all("/\{([^\}]+)\}/", $input_text, $matches);
			foreach ($matches[1] as $match){
				switch ($match){

					case "display_name":
						$replace = empty($user_data["display_name"]) ? $user_data["user_login"] : $user_data["display_name"];
						$return_text = str_replace("{".$match."}", $replace, $return_text);
						break;
					case "user_nicename":
						$replace = empty($user_data["user_nicename"]) ? $user_data["user_login"] : $user_data["user_nicename"];
						$return_text = str_replace("{".$match."}", $replace, $return_text);
						break;
					case "user_login":
						$return_text = str_replace("{".$match."}", $user_data["user_login"], $return_text);
						break;
					case "user_email":
						$return_text = str_replace("{".$match."}", $user_data["user_email"], $return_text);
						break;
					case "logout_link":
						$return_text = str_replace("{".$match."}", "<a href='".wp_logout_url($redirect_url)."'>". __('Odhlásiť', 'pwLogWi') ."</a>", $return_text);
						break;
					case "profile_link":
						$return_text = str_replace("{".$match."}", "<a href='".admin_url("profile.php")."'>". __('Profile', 'pwLogWi') ."</a>", $return_text);
						break;
					
					
				}
				
			}
			return $return_text;
		}
		
		/**
		 * Front-end display of widget.
		 *
		 * @see WP_Widget::widget()
		 *
		 * @param array $args     Widget arguments.
		 * @param array $instance Saved values from database.
		 *
		 */
		public function widget( $args, $instance ) {
		
			extract( $args );

			$before_widget = preg_replace('/class="/', 'class="'.$instance['css_class'].' ', $before_widget, 1);
			echo $before_widget;
			
			if ( !is_user_logged_in() || $instance['title_only_loggedout']!='yes' ){
				if (isset($instance['title'])){
					echo $before_title . $instance['title'] . $after_title;
				}	
			}
			
			if (isset($instance['css_class'])){
				$css_class = $instance[ 'css_class' ];
			}
			$include_remember_me = !empty($instance['include_remember_me']);
			if (isset($instance['default_form']) && $instance['default_form']=='register_form' ){
				$hide_login_div = "style='display: none'";
			}else{
				$hide_register_div = "style='display: none'";
			}
			if (isset($instance['float']) && $instance['float']=='horizontal'){
	
				$main_div_class="sp-main-div-horizontal";
				
			}else{
				
				$main_div_class="sp-main-div-vertical";
				
			}
			
			if (is_user_logged_in()){
				
				$user = wp_get_current_user();
				
				if ( isset( $instance['logged_in_text'] ) && !empty( $instance['logged_in_text'] ) ) {
					$logged_in_text = self::interapt_merge_tags($instance['logged_in_text'], $_SERVER['REQUEST_URI']);
				}else{
					$logged_in_text = self::interapt_merge_tags(__("Vitaj späť ", "pwLogWi") . "{user_login}. {logout_link}" , $_SERVER['REQUEST_URI']);
				}
				
				echo $logged_in_text;
				
			}else{
					$is_user_can_register = $this->check_user_can_register();
					$ajax_nonce = wp_create_nonce("sp-security-nonce");
					//wp_clear_auth_cookie();
					?>
					<div id="<?php echo "sp-main-div-".$this->id; ?>" class="sp-main-div <?php echo $main_div_class?>" >
					<div class="sp-login-header">
					<?php if (force_ssl_login()) : 
						if ( 0 === strpos($_SERVER['REQUEST_URI'], 'http') ) {
							$redirect =  set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) ;
						} else {
							$redirect = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ;
						}
						?>
						<div class="sp-ssl-requires-msg sp-error" style="display:none"><?php _e(sprintf("Login to this site requires ssl communication.<br>Click <a href='%s'>here</a> to reload the page over ssl.", $redirect), "pwLogWi")?></div>
					<?php endif;?>
					</div>
					<div class='sp-widget-login-div' <?php echo $hide_login_div; ?>>
					<form method="post" action="<?php echo wp_login_url() ?>" class="wp-user-form">
					<p><label for='user_login'><?php _e('Meno: ', 'pwLogWi') ?></label></p>
					<p ><input id='user_login' type='text' name='log' required='required' /></p>
					<p ><label for='user_pass'><?php _e('Heslo: ', 'pwLogWi') ?></label></p>
					<p ><input id='user_pass' type='password' name='pwd' required='required' /></p>
					<?php if ($include_remember_me){?>
					<p ><label for='rememberme1' ><input type='checkbox' name='rememberme' value='forever' <?php if ($instance['remember_me_def']=='check_by_default') echo "checked='checked'"; ?> id='rememberme1' /> <?php _e(' Remember me', 'pwLogWi') ?></label></p>
					<?php }?>
					<?php do_action('login_form'); ?>
					<p ><input type="submit" name="user-submit" value="<?php _e('Prihlásiť', 'pwLogWi')?>" /></p>
					<p>
					<input type="hidden" name="action" value="login">
					<input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>" />
					<input type="hidden" name="testcookie" value="1" />
					<input type="hidden" class="force_ssl_login" value="<?php echo json_encode(force_ssl_login()); ?>"/>
					<input type="hidden" name="security" value="<?php echo $ajax_nonce?>"/>
					</p>
					</form>
					<ul>
					<?php if ($is_user_can_register) :?>
						<li><a class="sp-flipping-link" href='<?php echo is_multisite() ? network_site_url('wp-signup.php') : '#sp-register' ; ?>'><?php _e('Ešte nemáte svoj účet?', 'pwLogWi') ?></a></li>
					<?php  endif; ?>
					<li><a class="sp-flipping-link" href='#lost-pass' ><?php _e('Zabudli ste heslo?', 'pwLogWi') ?></a></li>
					</ul>
					
					</div>
					
					<?php if ($is_user_can_register){?>
					<div class='sp-widget-register-div' <?php echo $hide_register_div; ?>>
				
					<form method="post" action="<?php echo add_query_arg( 'action' , 'register', wp_login_url() )  ?>" class="wp-user-form">
					<p ><label for='user_login'><?php _e('Zvoľ si meno ', 'pwLogWi') ?></label></p>
					<p ><input id='user_login' type='text' name='user_login' required='required' /></p>
					<p ><label for="user_email" ><?php _e('Tvoj email: ', 'pwLogWi') ?></label></p>
					<p ><input id="user_email" type="email" name="user_email" required="required" /></p>
					<?php do_action('register_form'); ?>
					<p ><input type="submit" name="user-submit" value="Registuj sa!" /></p>
					<p>
					<input type="hidden" name="action" value="register">
					<input type="hidden" name="redirect_to" value="<?php echo empty($_GET) ? $_SERVER['REQUEST_URI']."?register=true" : $_SERVER['REQUEST_URI']."&register=true" ; ?>" />
					<input type="hidden" name="testcookie" value="1" />
					<input type="hidden" name="security" value="<?php echo $ajax_nonce?>"/>
					</p>
					</form>
					<ul><li><a class="sp-flipping-link" href='#sp-login'><?php _e('Máš už účet?', 'pwLogWi') ?></a></li></ul>
					</div>
					<?php }?>
					
					<div class='sp-widget-lost_pass-div' style='display:none;'>
			
					<form method="post" action='<?php echo add_query_arg( 'action' , 'lostpassword', wp_login_url() ) ?>'>
					<p ><label for='user_login'><?php _e('Zadaj svoje užívateľské meno alebo e-mail: ', 'pwLogWi') ?></label></p>
					<p ><input type="text" name="user_login" value="" size="20" id="user_login" /></p>
					<?php do_action('login_form', 'resetpass')?>
					<p><input type="submit" name="user-submit" value="<?php _e('Obnoviť moje heslo', 'pwLogWi') ?>"  /></p>
					<p>
					<input type="hidden" name="action" value="lostpassword">
					<input type="hidden" name="redirect_to" value="<?php echo empty($_GET)? $_SERVER['REQUEST_URI']."?reset=true" : $_SERVER['REQUEST_URI']."&reset=true"; ?>" />
					<input type="hidden" name="testcookie" value="1" />
					<input type="hidden" name="security" value="<?php echo $ajax_nonce?>"/>
					<p>
					</form>
					<ul><li><a class="sp-flipping-link" href='#sp-login'><?php _e('Spät na prihlásenie', 'pwLogWi') ?></a></li></ul>
					</div>
					
					<input type="hidden"  class="is_ajax_authentication" value="<?php echo !empty($instance['ajax_authentication']) ? "1" : "0" ; ?>">
					
					<?php $reset = $_GET['reset']; if($reset == true) { echo '<p>' .  __('A message was sent to your email address', 'pwLogWi') . '</p>'; } ?>
					<div><?php $register = $_GET['register']; if($register == true) { echo '<p>' . __('Check your email for the password!', 'pwLogWi') . '</p>'; } ?></div>
					<div class="sp-loading-img" style="display:none; position: absolute;top: 50%;left: 50%;margin-left: -24px;margin-top: -24px;"><img src="<?php echo plugins_url("images/loading_transparent.gif", __FILE__)?>"  title="Loading" alt="Loading"></div>
					</div>
					<?php 
			}// end if user logged out state
				
				if (isset($instance['border']) && !empty($instance['border'])){
					echo "<script type='text/javascript'>
						jQuery('#{$this->id}').css('border', '1px solid {$instance['border_color']}');
						jQuery('#{$this->id}').css('border-radius', '4px');
					</script>";
				}
				
				echo $after_widget;
			}
			
			function check_user_can_register(){
				$register_url = wp_register('', '', false);
				return !empty($register_url);
			}
	
}


 


?>

Offline

#36 2014-02-12 16:13:53

zato
Endora uživatel
Registrován: 2010-12-10
Příspěvky: 37

Re: [Vyřešeno] Errory

<div class="widget"><h4 class="widget-title">SHOUTBOX</h4>	 <div class="textwidget"><frameborder="0" scrolling="no" width="200" height="400" src="http://miniaplikace.blueboard.cz/shoutboard.php?hid=93tfh2bfjhckb3sbp1773axk1r7m5t">
<a href="http://miniaplikace.blueboard.cz/shoutboard.php?hid=93tfh2bfjhckb3sbp1773axk1r7m5t">ShoutBoard od BlueBoard.cz</a>
</iframe>
</div>

- celý tento kód je nějaký divný. Nikde nevidím začátek iframe tagu a hned je tam frameborder. Pak ale tam je konec tagu <iframe>, buď si to umazal nebo nevím. Má to být <iframe width="200" height="400" src="http://miniaplikace.blueboard.cz/shoutboard.php?hid=93tfh2bfjhckb3sbp1773axk1r7m5t"></iframe>

<form method="post" action='<?php echo add_query_arg( 'action' , 'lostpassword', wp_login_url() ) ?>'>
<p ><label for='user_login'><?php _e('Zadaj svoje užívateľské meno alebo e-mail: ', 'pwLogWi') ?></label></p>
<p ><input type="text" name="user_login" value="" size="20" //////id="user_login"////// /></p>
<?php do_action('login_form', 'resetpass')?>
<div class='sp-widget-login-div' <?php echo $hide_login_div; ?>>
<form method="post" action="<?php echo wp_login_url() ?>" class="wp-user-form">
<p><label for='user_login'><?php _e('Meno: ', 'pwLogWi') ?></label></p>
<p ><input //////id='user_login'//////type='text' name='log' required='required' /></p>
<p ><label for='user_pass'><?php _e('Heslo: ', 'pwLogWi') ?></label></p>
<p ><input id='user_pass' type='password' name='pwd' required='required' /></p>

- v ////// jsem ti označil, kde je to duplicitní. Buď tam dát class a přes css přepsat #user_login na .user_login nebo zkusit smazat, jestli je to k nečemu potřeba.

Errorů je tam čím dál míň, to se mi líbí.

Upravil zato (2014-02-12 16:16:31)

Offline

#37 2014-02-12 16:49:05

SamerLP
Člen
Registrován: 2013-07-25
Příspěvky: 497

Re: [Vyřešeno] Errory

Ďakujem velmi pekne... http://validator.w3.org/check?uri=http% … 2Fservices už len 3 warny... a bude cely web validný!
a ešte prosím keď sa chcem cez ten login panel prihlásiť píše že potrebujem mať povolené cookies a to kde povolím prosím?

Offline

#38 2014-02-12 16:51:14

Lkopo
Podpora
Registrován: 2010-02-12
Příspěvky: 1,916
Web

Re: [Vyřešeno] Errory

Treba z tých HTML kódov vymazať atribút border="0" ... zrejme to máte v nejakom paneli. Radšej to dopísať do atribútu style ako:

border: 0;

Upravil Lkopo (2014-02-12 16:51:43)


Portfólio
E-mail: eduard(at)karpiel.sk

Offline

#39 2014-02-12 16:54:28

zato
Endora uživatel
Registrován: 2010-12-10
Příspěvky: 37

Re: [Vyřešeno] Errory

SamerLP napsal:

Ďakujem velmi pekne... http://validator.w3.org/check?uri=http% … 2Fservices už len 3 warny... a bude cely web validný!
a ešte prosím keď sa chcem cez ten login panel prihlásiť píše že potrebujem mať povolené cookies a to kde povolím prosím?

Smazal sis celý <input> pro zadání jména v přihlášení. Stačí smazat jen to id='user_login' čili výsledek bude:

<p ><input type='text' name='log' required='required' /></p>

a u druhého to bude

<p ><input type="text" name="user_login" value="" size="20" /></p>

A poslední chyba je: <a target="_blank" href="http://minelist.eu"><img alt="" src="http://minelist.eu/images/banner/banner88x31.png" border="0" /></a>
máš tam border="0"

- smaž to border="0" (je to v minelist.eu banneru a druhý je v toplistu)

Upravil zato (2014-02-12 16:57:43)

Offline

#40 2014-02-12 17:20:40

SamerLP
Člen
Registrován: 2013-07-25
Příspěvky: 497

Re: [Vyřešeno] Errory

OK super... veľmi ďakujem malo by to byť všetko myslím....
http://validator.w3.org/check?uri=http% … 2Fservices
ako pridám ikonu že je web validný ako je táto napr? http://www.w3.org/Icons/valid-xhtml10

Upravil SamerLP (2014-02-12 17:21:45)

Offline

#41 2014-02-12 17:43:03

kksmirice
Endora rádce
Místo: Vrchovnice
Registrován: 2011-11-20
Příspěvky: 6,023
Web

Re: [Vyřešeno] Errory

Proč chcete přidávat ikonu na nevalidní web?
To, že jste opravil jednu stránku, ještě neznamená, že na jiných chyby nemáte.


1. Murphyho zákon:
Na počátku nebylo nic. I to se pokazilo!

stránky: CMS test
kontakt - instalace systémů, MySQL, FTP přístup, ...
Instalační balíky vybraných CSM

Problémy spojené s provozem služeb Endora, řešte na tomto fóru.

Offline

#42 2014-02-12 18:32:58

SamerLP
Člen
Registrován: 2013-07-25
Příspěvky: 497

Re: [Vyřešeno] Errory

Offline

#43 2014-02-12 18:35:04

Trade
Endora rádce
Místo: Česká republika
Registrován: 2013-01-22
Příspěvky: 3,596
Web

Re: [Vyřešeno] Errory

Kde? Login na Vaší stránce mi funguje.


Kontaktujte nás | FAQ
Email: fk@endora.cz

Offline

#44 2014-02-12 18:48:15

zato
Endora uživatel
Registrován: 2010-12-10
Příspěvky: 37

Re: [Vyřešeno] Errory

SamerLP napsal:

http://www.hydra-craft.4fan.cz/vip/

<p><font color="#000000" size="7"><b><span style="background-color: rgb(0, 255, 0);">Sponzor</span></b></font></p> - Tag <font> se už dávno nepoužívá. Upravit na: <p style="color:#000000;font-size:45px;font-weight:bold;"><span style="background-color: rgb(0, 255, 0);">Sponzor</span></p>

<p><img alt="" height="151" src="http://files.quartcraft-sk.webnode.sk/200000003-7796f79870/images.jpg" width="334"></p>
</p></div> - Je vidět zakončení tagu <p> ale nikde není začátek - smazat </p> z kódu

http://www.hydra-craft.4fan.cz/teamspeak/

<div  ><center><div class="oznamy">Reklamu na tomto hostingu zajišťuje Business… - Tohle dělá reklama endory - lepší bude, když na konci kódu bude tag <endora></endrora> (nevím, jestli je párový nebo ne)

http://www.hydra-craft.4fan.cz/hlas/

<body background="img/back.jpg"> - změnit na <body style="background:url("img/back.jpg");">
A opět reklama co používá tag <center>

Upravil zato (2014-02-12 18:51:48)

Offline

#45 2014-02-12 18:51:57

Lkopo
Podpora
Registrován: 2010-02-12
Příspěvky: 1,916
Web

Re: [Vyřešeno] Errory

Endoru tag fixnúť zo strany používateľa nebude možné. Jedine, čo vidím je to <center>, tuším, že je to nastavím vďaka webadminu, kde si dal používateľ vycentrovať reklamu. Túto možnosť si vypnite.


Portfólio
E-mail: eduard(at)karpiel.sk

Offline

#46 2014-02-12 18:53:22

kksmirice
Endora rádce
Místo: Vrchovnice
Registrován: 2011-11-20
Příspěvky: 6,023
Web

Re: [Vyřešeno] Errory

tag <endora> není párový tag.
Jak již bylo několikráte napsáno, nepožadovat centrování a nastylovat si vše v CSS a vložit <div class="reklama_endora"><endora></div>.


1. Murphyho zákon:
Na počátku nebylo nic. I to se pokazilo!

stránky: CMS test
kontakt - instalace systémů, MySQL, FTP přístup, ...
Instalační balíky vybraných CSM

Problémy spojené s provozem služeb Endora, řešte na tomto fóru.

Offline

#47 2014-02-12 19:00:01

SamerLP
Člen
Registrován: 2013-07-25
Příspěvky: 497

Re: [Vyřešeno] Errory

Aha a ešte potrebujem to tretie hlasovanie sad
ale nechápem ako to je reklama ednory... žiadny tag som tam ja nedával sad

Offline

#48 2014-02-12 19:08:40

kksmirice
Endora rádce
Místo: Vrchovnice
Registrován: 2011-11-20
Příspěvky: 6,023
Web

Re: [Vyřešeno] Errory

Požadoval jste centrování reklamy. To je ten tag <center> ... </center>.
Pro reklamu také můžete použít za tímto účelem vytvořený plugin pro WP.


1. Murphyho zákon:
Na počátku nebylo nic. I to se pokazilo!

stránky: CMS test
kontakt - instalace systémů, MySQL, FTP přístup, ...
Instalační balíky vybraných CSM

Problémy spojené s provozem služeb Endora, řešte na tomto fóru.

Offline

#49 2014-02-12 19:51:01

zato
Endora uživatel
Registrován: 2010-12-10
Příspěvky: 37

Re: [Vyřešeno] Errory

SamerLP napsal:

Aha a ešte potrebujem to tretie hlasovanie sad
ale nechápem ako to je reklama ednory... žiadny tag som tam ja nedával sad

To jsem psal:

http://www.hydra-craft.4fan.cz/hlas/

<body background="img/back.jpg"> - změnit na <body style="background:url("img/back.jpg");">

Offline

#50 2014-02-12 19:58:21

SamerLP
Člen
Registrován: 2013-07-25
Příspěvky: 497

Re: [Vyřešeno] Errory

pridal som ten plugin a stále tu reklamu bere ako nevalidný tag pozrite aj tu: http://validator.w3.org/check?uri=http% … 2Fservices

Upravil SamerLP (2014-02-12 19:59:27)

Offline

Zápatí

Založeno na FluxBB | CZ a SK