MyBB Central

Full Version: Center the " Points: 0 (Edit)"
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
How do i center the " Points: 0 (Edit)" text? I want it to show like yours. In my forums it isnt centered.
Do you have a custom theme ? Cause on the default theme its already centered.
yes i do have a custom theme. How can i center it? What template do i edit?
You will need to add a span around the tag in inc/plugins.php. Look for the myps_display() function. Where it displays you need to add span tags around it along with a center css (text-align). That should do it.
Code:
function myps_display($post)
{
      global $mybb, $db, $lang, $plugins;

    $plugins->run_hooks("myps_display_start");

    $language = $mybb->settings['bblanguage'];
    $lang->load("myps");
    $lang->set_language($mybb->settings['bblanguage']);

if ($mybb->settings['myps_status'] != "off" && $post['uid'] != 0){

    $result = $db->query("SELECT * FROM `".TABLE_PREFIX."users` WHERE uid='".$post['uid']."'");
    $show = $db->fetch_array($result);
    $myps = round($show['myps'],$mybb->settings['myps_decimal']);
    $post['user_details'] = "<span class=\"smalltext\">{$post['user_details']} ".$mybb->settings['myps_name'].": <a href=\"myps.php?action=donate&username=". $post['username']. "\">$myps</a></b>";

  if($mybb->user['usergroup'] == "4" && $mybb->settings['myps_allowmod'] == 'mypspermadmin') {
    $post['user_details'] .= "<span class=\"smalltext\"> (<a href=\"myps.php?action=moderate&username=". $post['username']. "\">". $lang->myps_edit. "</a>)";
    }

  if(($mybb->user['usergroup'] == "3" || $mybb->user['usergroup'] == "4") && ($mybb->settings['myps_allowmod'] == 'mypspermsmods')) {
    $post['user_details'] .= "<span class=\"smalltext\"> (<a href=\"myps.php?action=moderate&username=". $post['username']. "\">". $lang->myps_edit. "</a>)";
    }

  if((is_moderator($fid) == "yes") && ($mybb->settings['myps_allowmod'] == 'mypspermall')) {
    $post['user_details'] .= "<span class=\"smalltext\"> (<a href=\"myps.php?action=moderate&username=". $post['username']. "\">". $lang->myps_edit. "</a>)";
    }

    $post['user_details'] .= "<br /></span>";

  }

    $plugins->run_hooks("myps_display_end");
}


ok i found it can you edit it to show how its supposed to look like? please
Try this:

PHP Code:
function myps_display($post)
{
      global 
$mybb$db$lang$plugins;

    
$plugins->run_hooks("myps_display_start");

    
$language $mybb->settings['bblanguage'];
    
$lang->load("myps");
    
$lang->set_language($mybb->settings['bblanguage']);

if (
$mybb->settings['myps_status'] != "off" && $post['uid'] != 0){

    
$result $db->query("SELECT * FROM `".TABLE_PREFIX."users` WHERE uid='".$post['uid']."'");
    
$show $db->fetch_array($result);
    
$myps round($show['myps'],$mybb->settings['myps_decimal']);
    
$post['user_details'] = "<span class=\"smalltext\" style=\"text-align:center\">{$post['user_details']} ".$mybb->settings['myps_name'].": <a href=\"myps.php?action=donate&username="$post['username']. "\">$myps</a></b>";

  if(
$mybb->user['usergroup'] == "4" && $mybb->settings['myps_allowmod'] == 'mypspermadmin') {
    
$post['user_details'] .= "<span class=\"smalltext\" style=\"text-align:center\">> (<a href=\"myps.php?action=moderate&username="$post['username']. "\">"$lang->myps_edit"</a>)";
    }

  if((
$mybb->user['usergroup'] == "3" || $mybb->user['usergroup'] == "4") && ($mybb->settings['myps_allowmod'] == 'mypspermsmods')) {
    
$post['user_details'] .= "<span class=\"smalltext\" style=\"text-align:center\">> (<a href=\"myps.php?action=moderate&username="$post['username']. "\">"$lang->myps_edit"</a>)";
    }

  if((
is_moderator($fid) == "yes") && ($mybb->settings['myps_allowmod'] == 'mypspermall')) {
    
$post['user_details'] .= "<span class=\"smalltext\" style=\"text-align:center\">> (<a href=\"myps.php?action=moderate&username="$post['username']. "\">"$lang->myps_edit"</a>)";
    }

    
$post['user_details'] .= "<br /></span>";

  }

    
$plugins->run_hooks("myps_display_end");

Nope its still in the same place but now it looks like this: Points: 7> (Edit)

you can see it here: http://www.console-crazy.com/showthread.php?tid=95

thanks for helping me i really appreciate it. Smile
That damn VB template causes too many problems and I really wish people would stop using it.

Undo all the change we did.

Use this solution from Lex.

var : variable ; like $post['userdetails']

Open ./inc/plugins/myps.php

Find [ function myps_display($post) ]

Replace the whole function with this
PHP Code:
function myps_display($post)
{
      global 
$mybb$db$lang$plugins;

    
$plugins->run_hooks("myps_display_start");

    
$language $mybb->settings['bblanguage'];
    
$lang->load("myps");
    
$lang->set_language($mybb->settings['bblanguage']);

    if (
$mybb->settings['myps_status'] != "off" && $post['uid'] != 0)
    {
        
$result $db->query("SELECT * FROM `".TABLE_PREFIX."users` WHERE uid='".$post['uid']."'");
        
$show $db->fetch_array($result);
        
$myps round($show['myps'],$mybb->settings['myps_decimal']);

        
$post['user_myps'] = "<span class=\"smalltext\">{$mybb->settings['myps_name']} : <a href=\"myps.php?action=donate&amp;username={$post['username']}\">{$myps}</a></b>";

          if(
$mybb->user['usergroup'] == "4" && $mybb->settings['myps_allowmod'] == 'mypspermadmin')
        {
            
$post['user_myps'] .= "<span class=\"smalltext\"> (<a href=\"myps.php?action=moderate&amp;username={$post['username']} \">{$lang->myps_edit}</a>)";
            }

          if((
$mybb->user['usergroup'] == "3" || $mybb->user['usergroup'] == "4") && ($mybb->settings['myps_allowmod'] == 'mypspermsmods')) 
        {
            
$post['user_myps'] .= "<span class=\"smalltext\"> (<a href=\"myps.php?action=moderate&amp;username={$post['username']} \">{$lang->myps_edit}</a>)";
            }

          if((
is_moderator($fid) == "yes") && ($mybb->settings['myps_allowmod'] == 'mypspermall'))
        {
            
$post['user_myps'] .= "<span class=\"smalltext\"> (<a href=\"myps.php?action=moderate&amp;username={$post['username']} \">{$lang->myps_edit}</a>)";
            }
      }

    
$plugins->run_hooks("myps_display_end");


Then you can use {$post['user_myps']} in your postbit template for showing the points where you want.

Try that.
tried that method. Now i cant see it at all. I put {$post['user_myps']} in post bit template/postbit_author_user
Template:
Code:
<center><span style="font-size:large; font-weight:bolder;">{$post['profilelink']}</span> {$post['onlinestatus']} {$post['iplogged']}<br /></center>

<center>
<span class="smalltext">
{$post['usertitle']}<br />
{$post['userstars']}<br />
{$post['groupimage']}</span>
{$post['useravatar']}<br /><br />

<span class="smalltext">
{$lang->postbit_joined} {$post['userregdate']}<br />
{$lang->postbit_posts} {$post['postnum']}<br />
{$lang->postbit_reputation} {$post['userreputation']}<br/>
{$post['user_myps']}</span>
</center>

im thinking that i can live with it not being centered on the mybulletin as long as it works perfect with all other themes.

Thanks for the help. Smile

-IncadudeF
Hmm..that should work though. I wonder if the hook has to be changed.
Pages: 1 2
Reference URL's