Arguments before and after a php tag
First of all, sorry for my bad english… I try to explain my intention as good as i can.
I tried to show this ” | ” before or after a php tag in my own template. For example my post.php contains this code
<div class="poststuff"><?php printf( __('Posted %s ago'), bb_get_post_time() ); ?> <a href="<?php post_anchor_link(); ?>">Permalink</a> <?php post_ip_link(); ?> <?php post_edit_link(); ?> <?php post_delete_link(); ?></div>
What i want is that e.g. before <?php post_ip_link(); ?> is displayed the above mentioned character. If i insert it before the php tag it also displayed to “normal users”. Normally the ip link is only displayed for admins. And so i´d like to see the | only as admin.
The output for normal users should look like this: Posted 38 minutes ago | Permalink
The output for admins should look like this: Posted 38 minutes ago | Permalink | 127.0.0.1 | Edit | Delete
If i add this “|” manually before the tags, for normal users it looks like this: Posted 38 minutes ago | Permalink | | |
Any ideas how this can be done?
You must be logged in to reply to this topic.