Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Excerpts, Read more, Pagination (http://forum.bytesforall.com/forumdisplay.php?f=20)
-   -   [SOLVED] Weird behaviour from Custom read more. (http://forum.bytesforall.com/showthread.php?t=13791)

Marco.s Apr 14, 2011 01:26 PM

[SOLVED] Weird behaviour from Custom read more.
 
Hi,
found a really weird issue related to the custom read more content and User roles.

Site is bilingual using qTranslate and I needed 2 separated "continue reading" lines...
Using the exec-php plugin (and thanks to another post in this forum section) I was able to set this:
PHP Code:

<?php if ( function_exists('qtrans_getLanguage') && qtrans_getLanguage()=="it") { ?>
<p>Leggi il resto di <a href="%permalink%"> %title% </a> per <a href="%permalink%#Altre%20Foto" rel="nofollow">altre foto</a> e <a href="%permalink%#Pedigree" rel="nofollow">Pedigree</a></p>
<?php } else { ?>
<p>Continue reading <a href="%permalink%"> %title% </a> for <a href="%permalink%#More%20Photos" rel="nofollow">more photos</a> and <a href="%permalink%#Pedigree" rel="nofollow">Pedigree</a></p>
<?php ?>

The code seemed to work randomly: some posts had the proper line, others showed both without any apparent logic.

Finally I realized the only posts showing the proper line where the ones written by administrative roles, while the other user's , with editor role, didn't execute the php IF.

I'm not sure if this is an issue related to Atahualpa or exec-php .
Anyway, since I can't assign the admin role to my editor (she's quite unexperienced and might f*** up the whole site in no time), is there an alternative, hardcoded way to add my custom read more?

Gave it a quick look, and seems bfa_post_parts.php is the file to work on.
Where should I insert the code, in that case? would shortcodes work?

edit: well, either hardcode my IF statement in the bfa_post_parts.php or place it in post_footer_multi so that it could execute php...

Marco.s Apr 14, 2011 05:27 PM

well, fixed the issue with a workaround and without messing with atahualpa code:
used Capability Manager plugin, added the proper flag to the editor role and now Editors can execute php aswell.

I guess that when executing the PHP code I used as "Custom read more", exec-php first looks in the user roles and checks it against the post authors. So even if it was the Admin who added the code in ATO, it is executed in the loop, and according to the post author role.

Solved ;)

juggledad Apr 14, 2011 06:21 PM

If you look at teh 'Exec-PHP' settings in the backend there is an option
Quote:

Executing PHP code in text widgets is not restricted to any user. By default users who can modify text widgets will also be able to execute PHP code in text widgets. Unselect this option to generally turn off execution of PHP code in text widgets.
you can set that option on and it should work for all users.

Glad you got it solved


All times are GMT -6. The time now is 02:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.