WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Sidebar misaligned (20 posts)

  1. jamaaludeen
    Member
    Posted 1 year ago #

    Hi

    I did not create this WordPress website, but I'm tasked to fix some errors.

    See page: http://www.hysasystems.org/?page_id=61&goog=1

    The sidebar is at the bottom instead of on the right. Can you see the error in the code:

    <?php
    /*
    Template Name: Students Page
    */
    function checkRemoteFile($url)
    {
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL,$url);
        // don't download content
        curl_setopt($ch, CURLOPT_NOBODY, 1);
        curl_setopt($ch, CURLOPT_FAILONERROR, 1);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        if(curl_exec($ch)!==FALSE)
        {
            return true;
        }
        else
        {
            return false;
        }
    }
    ?>
    
    <?php get_header(); ?>
    <div id="aligner">
    	<div id="mainpage">
    	<div id="section1">
    
            <div id="section1a">
    		<?php if($_SESSION['theurl']=="ccr"){$thebanner="http://www.hysasystems.org/wp-content/uploads/ccr/images/bannera.png";}
    		else if($_SESSION['theurl']=="hysa"){$thebanner="http://www.hysasystems.org/wp-content/uploads/hysa/images/foldbanner.png";}
    		else if($_SESSION['theurl']=="cchange"){$thebanner="http://www.hysasystems.org/wp-content/uploads/cchange/images/titlebanner1.jpg";} ?>
             <div id="sec1amenu"> <img src="<?php echo $thebanner; ?>" style="position:absolute;left:-17px"/>
                <h1 id="heading1"><?php $tit=get_the_title(); echo $tit;?></h1></div>
    			<div style="height:2px;background-color:#B6B1A8;width:100%"></div>
                <div id="maintext" style="margin:0; margin-bottom:.5em;font-size:0.8em;"> <div>
    				<?php
    					  // The Query
    						// The Loop
    						$myloop=0;
    						$count=0;
    						for($myloop=0;$myloop<2;$myloop++){
    						$count=0;
    						 $theheader="";
    						 if($myloop==0){
    						 	$theheader="Students";
    						 }
    						 else if($myloop==1){
    						 	$theheader="Spokes";
    						 }
    
    						 echo "<div style='padding:30px 0 10px 0'><div style='float:left;width:10px;height:10px;background-color:#f15f23;padding:3px'></div><div id='theheader' style='padding:0 10px;float:left;font-weight:500'>$theheader</div><div style='clear:both'></div></div>";
    						echo "<div>";
    
    $loop = new WP_Query( array( 'post_type' => 'student' ),'posts_per_page=1000','orderby=title','order=asc' ); 
    
    						 while ( $loop->have_posts() ) : $loop->the_post();
    						 $cchangepos=get_field("cchange_list_position");
    						 $hysapos=get_field("hysa_list_position");
    						 $catpos=get_field("catcenter_list_position");
    						 $mainpos=get_field("position");
    						 if($cchangepos==""){
    						 $cchangepos=7;
    						 }
    						 if($hysapos==""){
    						 $hysapos=7;
    						 }
    						 if($catpos==""){
    						 $catpos=7;
    						 }
    						// echo $cchangepos;
    						//while ( have_posts() ) : the_post();
    							//echo get_field('student_background');
    							//$id=the_ID();
    							//echo get_field('student_background');
    							//echo $theweb;
    							//$meta = get_post_meta($post->ID, "whichweb", true);
    							$meta = get_post_meta($post->ID, "which_websites_students", true);
    							$pos=0;
    							$pos2=0;
    							$pos3=0;
    							for($i=0;$i<count($meta);$i++){
    							if($meta[$i]=="hysa"){
    							$pos=1;
    							}
    							else if($meta[$i]=="ccr"){
    							$pos2=1;
    							}
    							else if($meta[$i]=="cchange"){
    							$pos3=1;
    							}
    							//echo $meta[$i];
    							}
    							$pos=1; $pos2=0; $pos3=0;
    							if($_SESSION['theurl']=="hysa"){
    							if($pos==1){
    							if($myloop==($hysapos-1)){
    
    							$count+=1;
    							$thum=get_post_thumbnail_id();
    							$pichysa=wp_get_attachment_url($thum);
    							echo "<div style='float:left; padding:5px 2px;'>";
    							echo "<a href='".get_permalink()."' style='text-decoration:none'>";
    							echo "<div style='width:142px;min-height:212px;padding:1px; background-color:#eeeeee'>";
    							$remfile=checkRemoteFile($pichysa);
    							if(!$remfile){
    							$pichysa="http://www.hysasystems.org/wp-content/themes/hysa-wordpress/default_user_icon.jpg";
    							}
    							echo "<img src='http://www.hysasystems.org/wp-content/themes/hysa_wordpress/timthumb/timthumb.php?src=$pichysa&w=142&h=192' />";
    							echo '<br>';
    							echo "<div style='text-align:center;color:#f15f23;padding:10px;'>";
    							//echo get_permalink();
    							echo the_title();
    							echo '<br>';
    							echo "</div>";
    							echo "</div>";
    							echo "</a>";
    							echo "</div>";
    							if(($count%4==0)&&($count!=0)){
    							echo "<div style='clear:both'></div>";
    								echo "</div><div style='height:20px;width:10px'></div><div>";
    							}
    							}
    							}
    							}
    							else if($_SESSION['theurl']=="ccr"){
    							if($pos2==1){
    							if($myloop==($catpos-1)){
    							$count+=1;
    
    							$thum=get_post_thumbnail_id();
    							$pichysa=wp_get_attachment_url($thum);
    							echo "<div style='float:left; padding:5px 2px;'>";
    							$perm= get_permalink();
    							$perm1=explode("?",$perm);
    							$perm2="http://www.catcentre.uct.ac.za/?".$perm1[1];
    							echo "<a href='".$perm2."' style='text-decoration:none'>";
    							echo "<div style='width:142px;min-height:212px;padding:1px; background-color:#eeeeee'>";
    							echo "<img src='http://www.hysasystems.org/wp-content/themes/hysa_wordpress/timthumb/timthumb.php?src=$pichysa&w=142&h=192' />";
    							echo '<br>';
    							echo "<div style='text-align:center;color:#336699;padding:10px;'>";
    							//echo get_permalink();
    							echo the_title();
    							echo '<br>';
    							echo "</div>";
    							echo "</div>";
    							echo "</a>";
    							echo "</div>";
    							if(($count%4==0)&&($count!=0)){
    							echo "<div style='clear:both'></div>";
    								echo "</div><div style='height:20px'></div><div>";
    							}
    							}
    							}
    							}
    							else if($_SESSION['theurl']=="cchange"){
    							if($pos3==1){
    							if($myloop==($cchangepos-1)){
    							$count+=1;
    
    							$thum=get_post_thumbnail_id();
    							$pichysa=wp_get_attachment_url($thum);
    							echo "<div style='float:left; padding:5px 2px;'>";
    							$perm= get_permalink();
    							$perm1=explode("?",$perm);
    							$perm2="http://www.cchange.ac.za/?".$perm1[1];
    							echo "<a href='".$perm2."' style='text-decoration:none'>";
    							echo "<div id='mypicbox' style='width:142px;min-height:212px;padding:1px; background-color:#eeeeee'>";
    							echo "<img src='http://www.hysasystems.org/wp-content/themes/hysa_wordpress/timthumb/timthumb.php?src=$pichysa&w=142&h=192' width='142px' height='192px' />";
    							//the_post_thumbnail();
    							echo '<br>';
    							echo "<div style='bottom:0;text-align:center;color:#c92e2f;padding:10px;'>";
    							//echo get_permalink();
    							echo the_title();
    							echo '<br>';
    							echo "</div>";
    							echo "</div>";
    							echo "</a>";
    							echo "</div>";
    							if(($count%4==0)&&($count!=0)){
    							echo "<div style='clear:both'></div>";
    								echo "</div><div style='height:20px'></div><div>";
    							}
    							}
    							}
    							}
    						endwhile;
    
    						// Reset Query
    						wp_reset_query();
    						}
    				?>
    				</div>
    			  </div>
              </div>
    </div>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
  2. Krishna
    Volunteer Moderator
    Posted 1 year ago #

  3. jamaaludeen
    Member
    Posted 1 year ago #

    Thanks Krishna.

    I'm backing up the site now. And I'll go through those links.

    Any tips on fixing the sidebar in the meantime?

  4. Krishna
    Volunteer Moderator
    Posted 1 year ago #

    Any tips on fixing the sidebar in the meantime?

    I think if you correct the markup errors (166 Errors and 4 warnings, see HERE), the side bar problem will be over.

    Additionally, you may look for CSS errors using Firebug and FF.

  5. jamaaludeen
    Member
    Posted 1 year ago #

    Thanks Krishna, I'm on it! :)

  6. Krishna
    Volunteer Moderator
    Posted 1 year ago #

    BTW, it seems the malware can be from the Ultimate Fade-in slideshow (v2.4). You may delete the script and check again if malware is reported (though it is not a real/ guaranteed solution, and the infection may still reappear).

  7. jamaaludeen
    Member
    Posted 1 year ago #

    Where do you pick this up?

    The active slideshow plugin is called "Meteor Slides" - There is no plugin called "Ultimate Fade-in slideshow (v2.4)"

  8. Krishna
    Volunteer Moderator
    Posted 1 year ago #

    From your site. See at the bottom of the script picked up by http://sitecheck.sucuri.net/results/www.hysasystems.org

    It is script. Type the name of the script on Google search, you can see the site distributing it. Possibly, one of the plugins used by you is using that script.

  9. jamaaludeen
    Member
    Posted 1 year ago #

    Thanks for your continued help, I seriously appreciate it! Thank you!

    According to this: http://www.hysasystems.org/wp-content/themes/hysa_wordpress/fadeslideshow.js - the javascript is authored by Dynamic Drive.

    None of the current plugins are authored by this company. Is it safe to assume that the javascript was left there by a previous plugin? If so, could the javascript file simply be deleted by ftp?

  10. Krishna
    Volunteer Moderator
    Posted 1 year ago #

    If so, could the javascript file simply be deleted by ftp?

    You may try it. But it is not a safe solution. It may still either be hiding somewhere or leaving loopholes for backdoor entry.
    http://codex.wordpress.org/Hardening_WordPress

    The author is listed at the top of this page by Google.

  11. jamaaludeen
    Member
    Posted 1 year ago #

    Ah! Thanks!

    Having looked at the demos of this slideshow (here), it seems that this slideshow is not being used on this site currently.

    Do you think I should delete the js?

  12. Krishna
    Volunteer Moderator
    Posted 1 year ago #

    Delete it.

  13. jamaaludeen
    Member
    Posted 1 year ago #

    I deleted it.

    The site still works fine.

    But the Sucuti SiteCheck still sees the js file as being there: http://sitecheck.sucuri.net/results/www.hysasystems.org

  14. Krishna
    Volunteer Moderator
    Posted 1 year ago #

    Click the link above and then click RE-SCAN. It verifies clean now.

  15. jamaaludeen
    Member
    Posted 1 year ago #

    Sorted, thanks! :)

    One down! :)

  16. Krishna
    Volunteer Moderator
    Posted 1 year ago #

    Clean? But keep scanning!

  17. jamaaludeen
    Member
    Posted 1 year ago #

    I'll keep scanning.

    But my sidebar is still misaligned. That was my initial problem.

  18. Krishna
    Volunteer Moderator
    Posted 1 year ago #

    Look at this validation report.

    1. Scroll down to the html, look at line 13 to 21. The remnants of the script, a legal notice, the URL of the script provider, etc. are still there. You need to delete them.
    2. Look at the number of markup errors. Either clear them. The sidebar and other problems may be over.
    3. Use firebug with FF and correct CSS that can reset your sidebar in its position.

  19. jamaaludeen
    Member
    Posted 1 year ago #

    Thankfully, I solved the sidebar issue in the code. See http://www.hysasystems.org/?page_id=61&goog=1

    :-)

    Your tips are valid though, and I will follow through on them, Thank you! :)

  20. Krishna
    Volunteer Moderator
    Posted 1 year ago #

    You are welcome!

Topic Closed

This topic has been closed to new replies.

About this Topic