Forum Replies Created

Viewing 15 replies - 1 through 15 (of 31 total)
  • Thread Starter jeegrobot

    (@jeegrobot)

    Thanks for your help. At the end the function apply_filters did the trick. I replaced my last line of code echo wpautop($newcontent); with echo apply_filters( 'the_content', $newcontent); and it worked.

    Thread Starter jeegrobot

    (@jeegrobot)

    I’ve found the problem. The theme uses this code for the content

    while (have_posts()) :
    	the_post();
    	$content    = get_the_content();
    	$newcontent = add_anchors($content);
    	echo wpautop($newcontent);
    

    It doesn’t use the function the_content because the custom function add_anchors that adds anchors to all the H2 headings, in order to link them to a TOC.

    Do you think there is a way to make the plugin work with this code?

    Thread Starter jeegrobot

    (@jeegrobot)

    Hi Ben,

    thanks for helping. I gave a try by switching the theme to a WordPress standard one and the shortcode works properly. So as you said, it’s a theme issue.

    I dig into it. Thanks for the input.

    Thread Starter jeegrobot

    (@jeegrobot)

    Thank you for having solved it so quickly. Great job!

    Thread Starter jeegrobot

    (@jeegrobot)

    Hi Alex, thanks for your reply. My URL is https://invalencia.info

    Thread Starter jeegrobot

    (@jeegrobot)

    Sorry, I’ve changed the textdomain and it was the problem.

    Forum: Hacks
    In reply to: Retrieving data from database
    Thread Starter jeegrobot

    (@jeegrobot)

    Ok, I found the solution. Just for your information, there is a call to wp-blog-header.php that goes to the root installation, by changing to the actual installation everything works.

    Thanks for your time.

    Forum: Hacks
    In reply to: Retrieving data from database
    Thread Starter jeegrobot

    (@jeegrobot)

    Hi kjodle,

    fist of all let me thank you for your help. I’ve discovered the problem, but I’m unable to find a solution. The problem is that WordPress is installed in a subfolder of another WordPress installation. wpdb is reading the root website database, instead of the subfolder installation database. How can I tell him to read the right db?

    Forum: Hacks
    In reply to: Retrieving data from database
    Thread Starter jeegrobot

    (@jeegrobot)

    No. Simply the data don’t appear.

    I’m having the same problem. My website have been attacked and I think this is related to the attack somehow.

    Did you find a solution?

    The problem follows the latest Nextgen Gallery updating.

    Same here. It was working until few days ago, but now it seems impossible. Same error message: Warning: imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions in /home/thesmart/public_html/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/class.ngglegacy_thumbnail.php on line 895

    WordPress version is 3.9.2 with the latest Nextgen Gallery

    These are the server settings:
    Operating System : Linux (64 Bit)
    Server : Apache
    Memory usage : 62.13 MByte
    MYSQL Version : 5.5.37-35.1
    SQL Mode : Not set
    PHP Version : 5.3.28
    PHP Safe Mode : Off
    PHP Allow URL fopen : On
    PHP Memory Limit : 256
    PHP Max Upload Size : 64M
    PHP Max Post Size : 64M
    PCRE Backtracking Limit : 1000000
    PHP Max Script Execute Time : 30s
    PHP Exif support : Yes ( V1.4 )
    PHP IPTC support : Yes
    PHP XML support : Yes
    Graphic Library

    GD Version : bundled (2.1.0 compatible)
    FreeType Support : Yes
    FreeType Linkage : with freetype
    T1Lib Support : No
    GIF Read Support : Yes
    GIF Create Support : Yes
    JPEG Support : Yes
    PNG Support : Yes
    WBMP Support : Yes
    XPM Support : No
    XBM Support : Yes
    JIS-mapped Japanese Font Support : No

    Thread Starter jeegrobot

    (@jeegrobot)

    Sorry in the previous code there was an useless table

    /* DASHBOARD WIDGET */
    /**
     * Add a widget to the dashboard.
     *
     * This function is hooked into the 'wp_dashboard_setup' action below.
     */
    function example_add_dashboard_widgets() {
    
    	wp_add_dashboard_widget(
                     'user_page_dashboard_widget',         // Widget slug.
                     'Personal page',         // Title.
                     'user_page_dashboard_widget_function' // Display function.
            );
    }
    add_action( 'wp_dashboard_setup', 'example_add_dashboard_widgets' );
    
    /**
     * Create the function to output the contents of our Dashboard Widget.
     */
    function user_page_dashboard_widget_function() {
    ?>
    <h2>Hello <span style="font-weight: bold;"><?php
    $current_user = wp_get_current_user();
    echo $current_user->user_login;
    ?></span> this is your recent activity</h2>
    <br />
    
    <?php
    
    	global $wpdb;
    	$current_user = wp_get_current_user();
    	$mail = $current_user->user_email;
    	$mlw_qmn_table_limit = 999;
    	$mlw_qmn_results_count = $wpdb->get_var( "SELECT COUNT(result_id) FROM " . $wpdb->prefix . "mlw_results WHERE deleted='0' AND email=%s",$mail );
    
    	if( isset($_GET['mlw_result_page'] ) )
    	{
    	   $mlw_qmn_result_page = $_GET['mlw_result_page'] + 1;
    	   $mlw_qmn_result_begin = $mlw_qmn_table_limit * $mlw_qmn_result_page ;
    	}
    	else
    	{
    	   $mlw_qmn_result_page = 0;
    	   $mlw_qmn_result_begin = 0;
    	}
    	$mlw_qmn_result_left = $mlw_qmn_results_count - ($mlw_qmn_result_page * $mlw_qmn_table_limit);
    	if (isset($_GET["quiz_id"]) && $_GET["quiz_id"] != "")
    	{
    		$mlw_quiz_data = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM " . $wpdb->prefix . "mlw_results WHERE deleted='0' AND email=%s AND quiz_id=%d ORDER BY result_id DESC LIMIT %d, %d",$mail, intval($_GET["quiz_id"]), $mlw_qmn_result_begin, $mlw_qmn_table_limit ) );
    	}
    	else
    	{
    		$mlw_quiz_data = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM " . $wpdb->prefix . "mlw_results WHERE deleted='0' AND email=%s ORDER BY result_id DESC LIMIT %d, %d",$mail, $mlw_qmn_result_begin, $mlw_qmn_table_limit ) );
    	}
    	?>
    
    	<h3 style="text-align: center;">Quizzes Taken</h3>
    
    	<?php
    	$quotes_list = "";
    	$display = "";
    	$alternate = "";
    	foreach($mlw_quiz_data as $mlw_quiz_info) {
    		if($alternate) $alternate = "";
    		else $alternate = " class=\"alternate\"";
    		$quotes_list .= "<tr{$alternate}>";
    
    		$quotes_list .= "<td>" . $mlw_quiz_info->quiz_name . "</td>";
    		if ($mlw_quiz_info->quiz_system == 0)
    		{
    			$quotes_list .= "<td class='post-title column-title'>" . $mlw_quiz_info->correct ." out of ".$mlw_quiz_info->total." or ".$mlw_quiz_info->correct_score."%</td>";
    		}
    		if ($mlw_quiz_info->quiz_system == 1)
    		{
    			$quotes_list .= "<td>" . $mlw_quiz_info->point_score . " Points</td>";
    		}
    		if ($mlw_quiz_info->quiz_system == 2)
    		{
    			$quotes_list .= "<td>Not Graded</td>";
    		}
    		$quotes_list .= "<td>" . $mlw_quiz_info->time_taken ."</td>";
    		$quotes_list .= "</tr>";
    	}
    
    	if( $mlw_qmn_result_page > 0 )
    	{
    	   	$mlw_qmn_previous_page = $mlw_qmn_result_page - 2;
    	   	$display .= "<a id=\"prev_page\" href=\"?page=mlw_quiz_results&&mlw_result_page=$mlw_qmn_previous_page\">Previous $mlw_qmn_table_limit Quizzes</a>";
    	   	if( $mlw_qmn_result_left > $mlw_qmn_table_limit )
    	   	{
    			$display .= "<a id=\"next_page\" href=\"?page=mlw_quiz_results&&mlw_result_page=$mlw_qmn_result_page\">Next $mlw_qmn_table_limit Quizzes</a>";
    	   	}
    	}
    	else if( $mlw_qmn_result_page == 0 )
    	{
    	   if( $mlw_qmn_result_left > $mlw_qmn_table_limit )
    	   {
    			$display .= "<a id=\"next_page\" href=\"?page=mlw_quiz_results&&mlw_result_page=$mlw_qmn_result_page\">Next $mlw_qmn_table_limit Quizzes</a>";
    	   }
    	}
    	else if( $mlw_qmn_result_left < $mlw_qmn_table_limit )
    	{
    	   $mlw_qmn_previous_page = $mlw_qmn_result_page - 2;
    	   $display .= "<a id=\"prev_page\" href=\"?page=mlw_quiz_results&&mlw_result_page=$mlw_qmn_previous_page\">Previous $mlw_qmn_table_limit Quizzes</a>";
    	}
    
    	$display .= "<table class=\"widefat\">";
    		$display .= "<thead><tr>
    
    			<th>Quiz Name</th>
    			<th>Score</th>
    
    			<th>Time Taken</th>
    		</tr></thead>";
    		$display .= "<tbody id=\"the-list\">{$quotes_list}</tbody>";
    		$display .= "</table>";
    	echo $display;
    
    }

    Any chance to create a small dashboard for the single users with the listing of the tests already taken?

    Thanks for your help.

    Thread Starter jeegrobot

    (@jeegrobot)

    Thanks. It’s perfect for what I was looking for.

Viewing 15 replies - 1 through 15 (of 31 total)