Forum Replies Created

Viewing 15 replies - 76 through 90 (of 113 total)
  • Thread Starter fas.khan

    (@faskhan)

    I am on Linux Server ??

    any other suggestion please.

    I am very thankful for your help.

    Thread Starter fas.khan

    (@faskhan)

    Hi Shane …

    As soon as I add this line … the server starts giving me Internal Server Error …

    Server error!

    The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.

    If you think this is a server error, please contact the webmaster.
    Error 500

    ??

    Any other suggestion please …

    Just in case, this is my htaccess file

    AddType application/x-httpd-fastphp5 .php
    Action application/x-httpd-fastphp5 /fcgi-bin/php5fcgi
    AddType application/x-httpd-php5 .php
    Action application/x-httpd-php5 /fcgi-bin/php5fcgi

    redirect 301 /aquawareness https://www.ewp.eu/projects/aquawareness
    redirect 301 /cca https://www.ewp.eu/projects/water-and-energy-climate-cca
    redirect 301 /erp https://www.ewp.eu/projects/european-reigonal-process-erp

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    Many Many Thanks

    Thread Starter fas.khan

    (@faskhan)

    any help please ??

    Thread Starter fas.khan

    (@faskhan)

    I think I made it very difficult to understand. I will re-write my problem.

    The problem is that my site is showing “Internal Server Error 500”

    Like this:-

    Server error!

    The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.

    When I went to the logs, there is only one error that is shown all around. It is regarding FastCGI and it says that there is an error in parsing headers (malperformed headers)

    The error is :-

    [Wed Jun 17 11:36:28 2009] [error] [client 119.152.24.177] FastCGI: comm with server “/home/httpd/vhosts/default/fcgi-bin/php5fcgi” aborted: error parsing headers: malformed header ‘HTTP/1.1 302 Found’, referer: https://www.ewp.eu/wp-login.php
    [Wed Jun 17 11:36:39 2009] [error] [client 158.169.131.14] FastCGI: comm with server “/home/httpd/vhosts/default/fcgi-bin/php5fcgi” aborted: error parsing headers: malformed header ‘HTTP/1.1 404 Not Found’, referer: https://www.ewp.eu/two-internships-at-the-european-water-partnership
    [Wed Jun 17 11:37:03 2009] [error] [client 65.55.209.75] FastCGI: comm with server “/home/httpd/vhosts/default/fcgi-bin/php5fcgi” aborted: error parsing headers: malformed header ‘HTTP/1.1 404 Not Found’
    [Wed Jun 17 11:37:57 2009] [error] [client 65.55.106.163] FastCGI: comm with server “/home/httpd/vhosts/default/fcgi-bin/php5fcgi” aborted: error parsing headers: malformed header ‘HTTP/1.1 301 Moved Permanently’
    [Wed Jun 17 11:38:43 2009] [error] [client 65.55.209.86] FastCGI: comm with server “/home/httpd/vhosts/default/fcgi-bin/php5fcgi” aborted: error parsing headers: malformed header ‘HTTP/1.1 404 Not Found’
    [Wed Jun 17 11:40:33 2009] [warn] RSA server certificate wildcard CommonName (CN) `*.apollohosting.com’ does NOT match server name!?
    [Wed Jun 17 11:42:41 2009] [error] [client 119.152.24.177] FastCGI: comm with server “/home/httpd/vhosts/default/fcgi-bin/php5fcgi” aborted: error parsing headers: malformed header ‘HTTP/1.1 302 Found’, referer: https://www.ewp.eu/wp-login.php

    Just for the Information, this is my htaccess file :-

    AddType application/x-httpd-fastphp5 .php
    Action application/x-httpd-fastphp5 /fcgi-bin/php5fcgi
    AddType application/x-httpd-php5 .php
    Action application/x-httpd-php5 /fcgi-bin/php5fcgi

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    I will be very thankful for any help.

    Many Thanks.

    Vous est magnifique monsieur!

    Thread Starter fas.khan

    (@faskhan)

    Thanks a lot for your reply.

    I have been looking at wp_list_pages but it lists all of the pages. The main problem comes, when I want to show the third level sub-pages only when the parent child at second level is clicked.

    So, this can be achieved:-
    (Current page: Home):
    – Page A
    – Page B
    – Page C
    – Page D

    But I cant figure out, how to achieve this:-
    (Current page: Page B, therefore I can see the sub-pages):
    – Page A
    – Page B
    – SubPage B1
    – SubPage B2
    – Page C
    – Page D

    I only want to show Subpage B1 and SubPage B2, when the second level child “Page B” is clicked.

    I have tried many plugins but none can do this cleanly.

    I would be very thankful for your assistance.

    Regards,
    F.

    Thread Starter fas.khan

    (@faskhan)

    But it is in the admin. and the space is being shown in the Editor where I write the post. Do you think it is due to the CSS of my theme?

    Many Thanks.

    Thread Starter fas.khan

    (@faskhan)

    I did it with this code.

    global $wpdb;
    					$prevalholder = array();
    					$arrctr = 0;
    					$matchFlag = false;
    					foreach($include_array as $sel_page_id)
    					{
    						$matchFlag = false;
    
    						if(wp_list_pages("title_li=&child_of=$sel_page_id&echo=0" )):
    
    							foreach($prevalholder as $previousValues)
    							{
    								// Check if this ID has any Parent. If it returns Zero, than there is no parent.
    								$idchecks = $wpdb->get_var( "select post_parent from $wpdb->posts where ID = $sel_page_id");
    								if ($idchecks == 0)
    								{
    									//It is a Top Parent
    									$matchFlag = false;
    									//echo "Not caught";
    								}
    								else
    								{
    									// It is not a Top Parent
    									$matchFlag = true;
    									//echo $sel_page_id . "CAUGHT    " ;
    								}
    
    							}
    							if (!$matchFlag)
    							{
    								//The current ID is the Top Parent. Add it in the Array.
    								$prevalholder[$arrctr] = $sel_page_id;
    								$matchFlag = false;
    								$arrctr ++;
    							}
    
    						endif;
    
    					}
    					//$prevalholder Array now holds all the Top Parent IDs.
    					foreach($prevalholder as $pVal)
    					{
    						echo "<br />Top Parent ID :  ". $pVal;
    					}
    Thread Starter fas.khan

    (@faskhan)

    Thank you for both the answers.

    But the first one tells whether the parent is category.

    And the second one takes the $post handler to tell whether the current page is parent or not.

    But I have only the ID and I cant proceed with the $post variable.

    Within my code, which is as follows, I am able to found out by ID that whether the current page is Parent or not.

    // Getting the Page ID in $sel_page_id.
    
    foreach($include_array as $sel_page_id)
    {	
    
    //Is it a parent
    if(wp_list_pages("title_li=&child_of=$sel_page_id&echo=0" )):
    
    echo $sel_page_id." is a parent";
    
    //else it is not!
    endif;

    It works perfectly but the only problem, it gives me all the parents. For example, It will give me with respect to the upper example, the following Pages.

    Home Link 1
    Home Link 2
    Home Link 3
    Home Link 4
    Sub Link 42 <—– I just dont want that, as it is not the Top Parent.

    Please help .. ??

    Thread Starter fas.khan

    (@faskhan)

    Any Help, please.

    I will rephrase it.

    With the help of the ID, I just want to see whether the page with the ID is the Top Parent.
    (At level 0)

    If it is at the second level (Level 1), I want to return false.

    For e.g.

    Home Link 1
    Home Link 2
    Home Link 3
    +++ Sub Link 31
    +++ Sub Link 32
    +++ Sub Link 33
    Home Link 4
    +++ Sub Link 41
    +++ Sub Link 42
    —+++ Sub Link 421
    —+++ Sub Link 422

    Now, if I get the Page ID of Home Link 3, I should have true, as it is the first parent. (And also true for Home Link 4 etc.)

    But, if I get the ID for Sub Link 42 (which is also a parent), my code should return false, as it is not at the Top Level.

    Many Thanks.

    Thread Starter fas.khan

    (@faskhan)

    any help regarding Page Templates?

    hehe! ??

    Why Alex?

    I also need it ??

    Scarlett, did you achieve this?

    oh, and $show is the number of posts to be showed.

    Do $show = 5, and it will show 5 most recent posts.

    Or use this code:-

    // GET POSTS
    		$r = new WP_Query(array('showposts' => $show, 'what_to_show' => 'posts', 'nopaging' => 0, 'post_status' => 'publish', 'caller_get_posts' => 1));
    		if ($r->have_posts()) :
    ?>
    		<?php echo $before_widget; ?>
    			<?php echo $before_title . $title . $after_title; ?>
    			<ul>
    			<?php  while ($r->have_posts()) : $r->the_post(); ?>
    			<li><a href="<?php the_permalink() ?>"><?php if ( get_the_title() ) the_title(); else the_ID(); ?> </a></li>
    			<?php endwhile; ?>
    			</ul>	
    
    <?php
    		// echo widget closing tag
    		echo $after_widget;
    
    		wp_reset_query();  // Restore global post data stomped by the_post().
    		endif;

Viewing 15 replies - 76 through 90 (of 113 total)