souf
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Read private post contributors// for pages
if ( current_user_can(‘contributor’) && !current_user_can(‘read_private_pages’) )
add_action(‘admin_init’, ‘permitir_leer_paginas_privadas_colaboradores’);function permitir_leer_paginas_privadas_colaboradores() {
$colaborador = get_role(‘contributor’);
$colaborador->add_cap(‘read_private_pages’);
}// for posts
if ( current_user_can(‘contributor’) && !current_user_can(‘read_private_posts’) )
add_action(‘admin_init’, ‘permitir_leer_entradas_privadas_colaboradores’);function permitir_leer_entradas_privadas_colaboradores() {
$colaborador = get_role(‘contributor’);
$colaborador->add_cap(‘read_private_posts’);
}Forum: Fixing WordPress
In reply to: Read private post contributorshi, i do the same, I put this changes in functions.php (theme), but it didn’t work.
Any solution?
thanksIt’s great!, Your solution fixes the problem.
A lot of thanks Andy
Ok, i will try to solve it.
Sorry, I typed incorrectly the php code in the message, but it was right in the widget:
<?php include("http://url_smf/SSI.php?ssi_function=recentTopics"); ?>
I wrote this because it was only to simplify the php code and it would be more easily understood.Finally, if I include the php file, it works, but not with include(“…”)
The final code:
<ul> <?php require("/path_to_smf/SSI.php"); $Lista = ssi_recentPosts($num_recent = 10, $exclude_boards = null, $include_boards = null, $output_method = 'array'); foreach ($Lista as $Post) { echo '<li><a target="_blank" href=', $Post['href'], '>', $Post['subject'], '</a></li>'; } unset($Lista); ?> </ul>Thanks
Hi,
I try to put only a include:
<?php include("http://url_smf/SSI.php?ssi_function=recentTopics"; ?>
And didn’t work:
Parse error: syntax error, unexpected ‘;’ in /path_to_wordpress/wp-content/plugins/php-code-widget/execphp.php(44) : eval()’d code on line 1function widget( $args, $instance ) { extract($args); $title = apply_filters( 'widget_title', empty($instance['title']) ? '' : $instance['title'], $instance ); $text = apply_filters( 'widget_execphp', $instance['text'], $instance ); echo $before_widget; if ( !empty( $title ) ) { echo $before_title . $title . $after_title; } ob_start(); /*Line 44*/ eval('?>'.$text); $text = ob_get_contents(); ob_end_clean(); ?> <div class="execphpwidget"><?php echo $instance['filter'] ? wpautop($text) : $text; ?></div> <?php echo $after_widget; }I didn’t known the problem (it’s not the problem for use ” or ‘).
I try to put a simple echo “Hello World”, and it works, but not with an a include…
Thanks