Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x
Author Message
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm



Joined: Aug 13, 2009
Posts: 1014
Location: Netherland

PostPosted: Fri Sep 26, 2014 7:06 am Reply with quote

Guys!! Today I decided to take a look at the block: block-TrickedOutSliderV2.php

OLD and it will give you some validation warnings

Code:
<?php

###############################################################################
# TrickedOutSliderV2 Block http://trickedoutnews.com
# Redesign by Killing Hours
###############################################################################
# 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 2 of the License.
###############################################################################
if (stristr($_SERVER['SCRIPT_NAME'], "block-TrickedOutSliderV2.php"))
{
   Header("Location: ../../index.php");
   die();
}

require_once('mainfile.php');
global $db, $prefix;

$sql = "SELECT slidertitle1, slidertitle2, slidertitle3, slidertitle4, slidertitle5, slidertitle6, slidercontent1, slidercontent2, slidercontent3, slidercontent4, slidercontent5, slidercontent6, sliderthumb1, sliderthumb2, sliderthumb3, sliderthumb4, sliderthumb5, sliderthumb6 FROM ".$prefix."_tonsliderV2";
    $result = $db->sql_query($sql);
    $row = $db->sql_fetchrow($result);
   
   $slidertitle1 = stripslashes(check_html($row['slidertitle1'], 'nohtml'));
    $slidertitle2 = stripslashes(check_html($row['slidertitle2'], 'nohtml'));
    $slidertitle3 = stripslashes(check_html($row['slidertitle3'], 'nohtml'));
    $slidertitle4 = stripslashes(check_html($row['slidertitle4'], 'nohtml'));
    $slidertitle5 = stripslashes(check_html($row['slidertitle5'], 'nohtml'));
    $slidertitle6 = stripslashes(check_html($row['slidertitle6'], 'nohtml'));
    $slidercontent1 = stripslashes($row['slidercontent1']);
    $slidercontent2 = stripslashes($row['slidercontent2']);
    $slidercontent3 = stripslashes($row['slidercontent3']);
    $slidercontent4 = stripslashes($row['slidercontent4']);
    $slidercontent5 = stripslashes($row['slidercontent5']);
    $slidercontent6 = stripslashes($row['slidercontent6']);
    $sliderthumb1 = stripslashes(check_html($row['sliderthumb1'], 'nohtml'));
    $sliderthumb2 = stripslashes(check_html($row['sliderthumb2'], 'nohtml'));
    $sliderthumb3 = stripslashes(check_html($row['sliderthumb3'], 'nohtml'));
    $sliderthumb4 = stripslashes(check_html($row['sliderthumb4'], 'nohtml'));
    $sliderthumb5 = stripslashes(check_html($row['sliderthumb5'], 'nohtml'));
    $sliderthumb6 = stripslashes(check_html($row['sliderthumb6'], 'nohtml'));

$content = '<div id="one" class="contentslider">';
$content .= '<div class="cs_wrapper">';
$content .= '<div class="cs_slider">';
$content .= '<div class="cs_article">';
$content .= '<h2><a href="#">' . $slidertitle1 . '</a> </h2>';
$content .= '<img src="TrickedOutSliderV2/images/'.$sliderthumb1.'" alt="" />';                  
$content .= '<p>' . $slidercontent1 . '</p></div>';
$content .= '<div class="cs_article">';
$content .= '<h2><a href="#">' . $slidertitle2 . '</a> </h2>';
$content .= '<img src="TrickedOutSliderV2/images/'.$sliderthumb2.'" alt="" />';
$content .= '<p>' . $slidercontent2 . '</p></div>';
$content .= '<div class="cs_article">';
$content .= '<h2><a href="#">' . $slidertitle3 . '</a> </h2>';               
$content .= '<img src="TrickedOutSliderV2/images/'.$sliderthumb3.'" alt="" />';   
$content .= '<p>' . $slidercontent3 . '</p></div>';
$content .= '<div class="cs_article">';
$content .= '<h2><a href="#">' . $slidertitle4 . '</a> </h2>';
$content .= '<img src="TrickedOutSliderV2/images/'.$sliderthumb4.'" alt="" />';
$content .= '<p>' . $slidercontent4 . '</p></div>';
$content .= '<div class="cs_article">';
$content .= '<h2><a href="#">' . $slidertitle5 . '</a> </h2>';               
$content .= '<img src="TrickedOutSliderV2/images/'.$sliderthumb5.'" alt="" />';   
$content .= '<p>' . $slidercontent5 . '</p></div>';
$content .= '<div class="cs_article">';
$content .= '<h2><a href="#">' . $slidertitle6 . '</a> </h2>';
$content .= '<img src="TrickedOutSliderV2/images/'.$sliderthumb6.'" alt="" />';
$content .= '<p>' . $slidercontent6 . '</p></div>';
$content .= '</div>';
$content .= '</div>';
$content .= '</div>';
?>


Updated and Validated by me.

Code:
<?php

###############################################################################
# TrickedOutSliderV2 Block http://trickedoutnews.com
# Redesign by Killing Hours
###############################################################################
# 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 2 of the License.
###############################################################################
if (!defined('BLOCK_FILE')) {Header('Location: ../index.php');  die();}
if (!defined('PHP_EOL')) define('PHP_EOL', strtoupper(substr(PHP_OS,0,3) == 'WIN') ? "\r\n" : "\n");


//require_once('mainfile.php');
global $db, $prefix;

$sql = 'SELECT `slidertitle1`, `slidertitle2`, `slidertitle3`, `slidertitle4`, `slidertitle5`, `slidertitle6`, `slidercontent1`, `slidercontent2`, `slidercontent3`, `slidercontent4`, `slidercontent5`, `slidercontent6`, `sliderthumb1`, `sliderthumb2`, `sliderthumb3`, `sliderthumb4`, `sliderthumb5`, `sliderthumb6` FROM `' . $prefix . '_tonsliderV2';
    $result = $db->sql_query($sql);
    $row = $db->sql_fetchrow($result);

    $slidertitle1 = stripslashes(check_html($row['slidertitle1'], 'nohtml'));
    $slidertitle2 = stripslashes(check_html($row['slidertitle2'], 'nohtml'));
    $slidertitle3 = stripslashes(check_html($row['slidertitle3'], 'nohtml'));
    $slidertitle4 = stripslashes(check_html($row['slidertitle4'], 'nohtml'));
    $slidertitle5 = stripslashes(check_html($row['slidertitle5'], 'nohtml'));
    $slidertitle6 = stripslashes(check_html($row['slidertitle6'], 'nohtml'));
    $slidercontent1 = stripslashes($row['slidercontent1']);
    $slidercontent2 = stripslashes($row['slidercontent2']);
    $slidercontent3 = stripslashes($row['slidercontent3']);
    $slidercontent4 = stripslashes($row['slidercontent4']);
    $slidercontent5 = stripslashes($row['slidercontent5']);
    $slidercontent6 = stripslashes($row['slidercontent6']);
    $sliderthumb1 = stripslashes(check_html($row['sliderthumb1'], 'nohtml'));
    $sliderthumb2 = stripslashes(check_html($row['sliderthumb2'], 'nohtml'));
    $sliderthumb3 = stripslashes(check_html($row['sliderthumb3'], 'nohtml'));
    $sliderthumb4 = stripslashes(check_html($row['sliderthumb4'], 'nohtml'));
    $sliderthumb5 = stripslashes(check_html($row['sliderthumb5'], 'nohtml'));
    $sliderthumb6 = stripslashes(check_html($row['sliderthumb6'], 'nohtml'));

$content = '<div id="one" class="contentslider">' . PHP_EOL
         . '<div class="cs_wrapper">' . PHP_EOL
         . '<div class="cs_slider">' . PHP_EOL
         . '<div class="cs_article">' . PHP_EOL
         . '<h2><a href="#">' . $slidertitle1 . '</a> </h2>' . PHP_EOL
         . '<img src="TrickedOutSliderV2/images/' . $sliderthumb1 . '" alt="" />' . PHP_EOL
         . $slidercontent1 . '</div>' . PHP_EOL
         . '<div class="cs_article">' . PHP_EOL
         . '<h2><a href="#">' . $slidertitle2 . '</a> </h2>' . PHP_EOL
         . '<img src="TrickedOutSliderV2/images/' . $sliderthumb2 . '" alt="" />' . PHP_EOL
         . $slidercontent2 . '</div>' . PHP_EOL
         . '<div class="cs_article">' . PHP_EOL
         . '<h2><a href="#">' . $slidertitle3 . '</a> </h2>' . PHP_EOL
         . '<img src="TrickedOutSliderV2/images/' . $sliderthumb3 . '" alt="" />' . PHP_EOL
         . $slidercontent3 . '</div>' . PHP_EOL
         . '<div class="cs_article">' . PHP_EOL
         . '<h2><a href="#">' . $slidertitle4 . '</a> </h2>' . PHP_EOL
         . '<img src="TrickedOutSliderV2/images/' . $sliderthumb4 . '" alt="" />' . PHP_EOL
          . $slidercontent4 . '</div>' . PHP_EOL
         . '<div class="cs_article">' . PHP_EOL
         . '<h2><a href="#">' . $slidertitle5 . '</a> </h2>' . PHP_EOL
         . '<img src="TrickedOutSliderV2/images/' . $sliderthumb5 . '" alt="" />' . PHP_EOL
         . $slidercontent5 . '</div>' . PHP_EOL
         . '<div class="cs_article">' . PHP_EOL
         . '<h2><a href="#">' . $slidertitle6 . '</a> </h2>' . PHP_EOL
         . '<img src="TrickedOutSliderV2/images/' . $sliderthumb6 . '" alt="" />' . PHP_EOL
         . $slidercontent6 . '</div>' . PHP_EOL
         . '</div>' . PHP_EOL
         . '</div>' . PHP_EOL
         . '</div>' . PHP_EOL;




Last edited by hicuxunicorniobestbuildpc on Fri Sep 26, 2014 9:08 am; edited 1 time in total 
View user's profile Send private message Visit poster's website
neralex
Site Admin



Joined: Aug 22, 2007
Posts: 1537

PostPosted: Fri Sep 26, 2014 8:05 am Reply with quote

Can't find any validation issues in the original code but you have removed the p-tag that was important to get space between the image and the content and you have some really unneeded stuff like this in your changes:

Code:
. '' . $slidercontent6


Why you have created an empty string ''?

Not better much more wired. Wink

_________________
Github: RavenNuke 
View user's profile Send private message
hicuxunicorniobestbuildpc







PostPosted: Fri Sep 26, 2014 9:10 am Reply with quote

Yes neralex, thanks for the info. I corrected my little mistake but it did have validation warning. Take a look


Code:
Error Line 305, Column 321: document type does not allow element "p" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag


    …US_RAMPAGEVEXTREME.png" alt="" /><p><p><strong>Asus Rampage V Extreme</strong>…



    The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

    One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
    Error Line 306, Column 152: document type does not allow element "p" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag

    … </h2><img src="TrickedOutSliderV2/images/CoolerMasterHAFX.png" alt="" /><p><p>

   

    The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

    One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
    Error Line 308, Column 163: document type does not allow element "p" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag

    …><img src="TrickedOutSliderV2/images/GSkill16GBDDR42133Kit.png" alt="" /><p><p>



    The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

    One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
    Error Line 310, Column 161: document type does not allow element "p" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag

    …/h2><img src="TrickedOutSliderV2/images/GSkillDDR43200Quad.png" alt="" /><p><p>



    The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

    One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
    Error Line 312, Column 154: document type does not allow element "p" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag

    … </h2><img src="TrickedOutSliderV2/images/i7_5930K_3_5_GHz.png" alt="" /><p><p>



    The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

    One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
    Error Line 314, Column 157: document type does not allow element "p" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag

    …><img src="TrickedOutSliderV2/images/Samsung850Pro251TBSSD.png" alt="" /><p><p>


    The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

    One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").



Note: As you see the editor already created the element <p> when you write it but in the block was inserted as an extra one. I don't know what block u have.
 
neralex







PostPosted: Fri Sep 26, 2014 10:51 am Reply with quote

The error apears only if the content is empty because the p-tag shouldn't stay empty and related to the idea of the block should have every slide a typed content. The cause because the editor creates empty p-tag s is only a misconfiguration of your editor and not a issue of the block-file. If you don't know how you can configure the editor, you could open the source code tab of the editor, remove the p-tag and press SAVE. Done.

The other possible way could be to change the p-tag around the content variables to a div with a css based padding in order to not remove the space between the image and the content. Other users could maybe need this space.

Now you can see, thats not really a solution for everyone. It works for you, fine! But what is with the rest and why don't you post it here and not on related homepage of the slider?

That is not a official update, that is only a way for you.
 
hicuxunicorniobestbuildpc







PostPosted: Fri Sep 26, 2014 4:45 pm Reply with quote

Sorry I didn't reply before. I was really busy at work.

Quote:
The error apears only if the content is empty because the p-tag shouldn't stay empty and related to the idea of the block should have every slide a typed content. The cause because the editor creates empty p-tag s is only a misconfiguration of your editor and not a issue of the block-file. If you don't know how you can configure the editor, you could open the source code tab of the editor, remove the p-tag and press SAVE. Done.


Do you think knowing how you go behind my posts I didn't check this before? Every time I remove the p-tag is gonna be the same. The editor creates a p tag automatically and u know that. Anyway after doing this modification it works good for me and it is validated. I changed admin file as well and it is working really fast. I've been changing and updating lost of old blocks and modules and the loading time from my website is 2 seconds. Very Happy
 
neralex







PostPosted: Fri Sep 26, 2014 5:10 pm Reply with quote

hicuxunicorniobestbuildpc wrote:
The editor creates a p tag automatically and u know that.


... that isn't true, re-read my lines again. Its simply a question of the configuration on the ck editor. You will find all answers to configure the editor in the documentations. Please don't drive the users in wrong directions.

BTW i need more than 10sec to load your website lol


Last edited by neralex on Fri Sep 26, 2014 5:18 pm; edited 1 time in total 
hicuxunicorniobestbuildpc







PostPosted: Fri Sep 26, 2014 5:18 pm Reply with quote

Hmmm. I wish I could u were not right but u are.

Very Happy
[ Only registered users can see links on this board! Get registered or login! ]

Well, I don't think so many people notice about this! Believe me.
 
neralex







PostPosted: Fri Sep 26, 2014 5:25 pm Reply with quote

To make the mistake to believe you only a single word, can not happen. believe me!
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©