SimplePortal

Support => English Support => Topic started by: curlin on January 14, 2010, 12:29:57 PM

Title: Poll Block
Post by: curlin on January 14, 2010, 12:29:57 PM
     Hi

      Have set up a poll which shows fine in a block and clicking on the view topic link in the block also works. But clicking "Submit Vote" leads to just a blank, white screen. I've loaded up a fresh SSI.php file via ftp but no change. Some help please and thank you.

   Using latest versions of smf and sp.
Title: Re: Poll Block
Post by: curlin on January 15, 2010, 08:42:40 PM
    bump
Title: Re: Poll Block
Post by: curlin on January 17, 2010, 11:38:25 PM
   Anyone  :0

  bump
Title: Re: Poll Block
Post by: Robbo on January 18, 2010, 11:44:22 AM
Seems to work fine for me. SSI.php shouldn't matter.

Any chance you can link me to where this is happening?
Title: Re: Poll Block
Post by: curlin on January 18, 2010, 02:26:47 PM
    Yes but my site isn't 100% finished so could i pm it to you?
Title: Re: Poll Block
Post by: [SiNaN] on January 20, 2010, 04:00:16 PM
You can pm it to me.
Title: Re: Poll Block
Post by: curlin on January 20, 2010, 04:30:55 PM
   well, it won't let me send a pm for some reason so here is the site - http://www.tbredjkie.byethost15.com

    Having trouble with the right side blocks

   Latest member block - doesn't show avatars
   Poll block - can't vote - leads to white screen
   last 3 blocks - title text has black color when the text should be white like the rest.

Title: Re: Poll Block
Post by: ccbtimewiz on January 21, 2010, 02:02:40 AM
Latest member block is not supposed to show avatars when you have it configured to show more than one.

The poll block apparently relies on SSI.php-- and your SSI.php is not loading properly. Refer to:

http://www.tbredjkie.byethost15.com/ssi_examples.php
http://www.tbredjkie.byethost15.com/SSI.php

All of them result in blank screen. Please ensure those files are fresh.

I'd wager a guess that the last issue is because of a clear or something resetting the class rule... that may or may not be a bug. Try playing around with how you put the blocks out.
Title: Re: Poll Block
Post by: curlin on January 21, 2010, 02:09:04 AM
       Thank You ccb

   I'll look at that tomorrow.
Title: Re: Poll Block
Post by: curlin on January 21, 2010, 01:55:56 PM
Latest member block is not supposed to show avatars when you have it configured to show more than one.

     Ok - just starting to look at these issues now and this one - latest member- still is not working. I re-checked to make sure it is set to show only "1'. I even deleted the block and created a new one but still the same result.
Title: Re: Poll Block
Post by: [SiNaN] on January 21, 2010, 03:24:41 PM
It doesn't display avatar of latest member(s) since 2.2. It did in older versions though.
Title: Re: Poll Block
Post by: curlin on January 21, 2010, 07:05:41 PM
It doesn't display avatar of latest member(s) since 2.2. It did in older versions though.

      Oh

    Is there something i can add so it does?
Title: Re: Poll Block
Post by: curlin on January 21, 2010, 07:26:37 PM
Latest member block is not supposed to show avatars when you have it configured to show more than one.

The poll block apparently relies on SSI.php-- and your SSI.php is not loading properly. Refer to:

http://www.tbredjkie.byethost15.com/ssi_examples.php
http://www.tbredjkie.byethost15.com/SSI.php

All of them result in blank screen. Please ensure those files are fresh.

I'd wager a guess that the last issue is because of a clear or something resetting the class rule... that may or may not be a bug. Try playing around with how you put the blocks out.

     I uploaded fresh copies of those 2 files but still no change. I noticed i also have this SSI.php~
Title: Re: Poll Block
Post by: [SiNaN] on January 22, 2010, 08:55:59 AM
      Oh

    Is there something i can add so it does?

You can use this code in a Custom PHP block:

Code: [Select]
global $context, $memberContext, $modSettings, $color_profile;

$latest_member_id = $context['common_stats']['latest_member']['id'];
loadMemberData($latest_member_id);
loadMemberContext($latest_member_id);

echo '
<div style="text-align: center;">';

if (!empty($memberContext[$latest_member_id]['avatar']['href']))
echo '
<img src="'.$memberContext[$latest_member_id]['avatar']['href'].'" alt="" width="60" /><br />';

echo '
', $memberContext[$latest_member_id]['link'], '
</div>';

     I uploaded fresh copies of those 2 files but still no change. I noticed i also have this SSI.php~

I would suggest seeking help on that issue at simplemachines.org communtiy. That issue is beyond the scope of this mod. Once you get SSI.php file working fine, poll block should work fine as well.
Title: Re: Poll Block
Post by: curlin on January 22, 2010, 12:14:40 PM
     Ok - i will.  Thanks again.
Title: Re: Poll Block
Post by: curlin on January 23, 2010, 11:50:07 AM
     Thanks for the latest member code - works great  ;D

   However - the ball has been served back into your court - http://www.simplemachines.org/community/index.php?topic=361649.0
Title: Re: Poll Block
Post by: [SiNaN] on January 23, 2010, 12:23:40 PM
I have replied to that topic.
Title: Re: Poll Block
Post by: curlin on January 23, 2010, 05:35:43 PM
I have replied to that topic.

      :applause:

   And you look quite abit different over there  :P
Title: Re: Poll Block
Post by: curlin on January 25, 2010, 01:35:09 PM
      Ok - so this block won't fully function for me so i would like to set it up to only show the results of the on going poll. I looked in the poll options but don't see how to set it this way. Is there something i can change in the poll block code to do this?

                                                         Thanks
Title: Re: Poll Block
Post by: curlin on January 26, 2010, 12:48:59 PM
     Anyone :0

  I'd like to keep this block for viewing poll results but if i can't set it up that way, unfortunately i'll have to remove it.
Title: Re: Poll Block
Post by: curlin on January 29, 2010, 01:54:44 AM
    If it cannot be done then just say so and i'll have to remove it  :(
Title: Re: Poll Block
Post by: [SiNaN] on January 29, 2010, 10:02:38 AM
      :applause:

   And you look quite abit different over there  :P

Different, you mean?

      Ok - so this block won't fully function for me so i would like to set it up to only show the results of the on going poll. I looked in the poll options but don't see how to set it this way. Is there something i can change in the poll block code to do this?

                                                         Thanks

Does SSI.php and ssi_examples.php files fully function?

    If it cannot be done then just say so and i'll have to remove it  :(

If you want, you can provide me a temporary FTP and admin access to your forum and I'll check it out for you.

Title: Re: Poll Block
Post by: [SiNaN] on January 29, 2010, 12:18:13 PM
For some reason SSI.php still didn't work. So I modified poll block to use ?action=vote instead of SSI pollVote.

Reason for some blocks having black titles was a <font> tag left open in the custom articles block.

Menu block was screwed when hovered on some items, because it had sp_block class assigned to body which has an overflow. I just removed it from menu block.

So I guess issues are fixed so marking the topic as solved.
Title: Re: Poll Block
Post by: curlin on January 29, 2010, 12:22:28 PM
     Yes, and again Thank You  ;D
Title: Re: Poll Block
Post by: curlin on February 09, 2010, 12:28:28 PM
      Oh

    Is there something i can add so it does?

You can use this code in a Custom PHP block:

Code: [Select]
global $context, $memberContext, $modSettings, $color_profile;

$latest_member_id = $context['common_stats']['latest_member']['id'];
loadMemberData($latest_member_id);
loadMemberContext($latest_member_id);

echo '
<div style="text-align: center;">';

if (!empty($memberContext[$latest_member_id]['avatar']['href']))
echo '
<img src="'.$memberContext[$latest_member_id]['avatar']['href'].'" alt="" width="60" /><br />';

echo '
', $memberContext[$latest_member_id]['link'], '
</div>';

     I uploaded fresh copies of those 2 files but still no change. I noticed i also have this SSI.php~

I would suggest seeking help on that issue at simplemachines.org communtiy. That issue is beyond the scope of this mod. Once you get SSI.php file working fine, poll block should work fine as well.

      Hi SiNaN

   I used the code below to add a default avatar to those that don't select one and it shows in the posts but not in the newest member block you setup for me with this code. Could you tell me what i need to add for the default avatar to show in the newest member block?

                                                            Thank You

Code: [Select]
// Default avatar. ^^
if (empty($memberContext[$user]['avatar']['image']))
   $memberContext[$user]['avatar']['image'] = '<img src="' . $settings['images_url'] . '/default_avatar.png" alt="Default Avatar" title="Default Avatar" width="' . $avatar_width . '" height="' . $avatar_height . '" />';

// First do a quick run through to make sure there is something to be shown.
$memberContext[$user]['has_messenger'] = false;
Title: Re: Poll Block
Post by: Chen Zhen on February 09, 2010, 11:54:53 PM
      Hi SiNaN

   I used the code below to add a default avatar to those that don't select one and it shows in the posts but not in the newest member block you setup for me with this code. Could you tell me what i need to add for the default avatar to show in the newest member block?

                                                            Thank You

Code: [Select]
// Default avatar. ^^
if (empty($memberContext[$user]['avatar']['image']))
   $memberContext[$user]['avatar']['image'] = '<img src="' . $settings['images_url'] . '/default_avatar.png" alt="Default Avatar" title="Default Avatar" width="' . $avatar_width . '" height="' . $avatar_height . '" />';

// First do a quick run through to make sure there is something to be shown.
$memberContext[$user]['has_messenger'] = false;

Using FTP navigate to this file:
/ Sources / PortalBlocks.php

Find:
Code: [Select]
function sp_userInfo($parameters, $id, $return_parameters = false)
{
global $context, $txt, $scripturl, $memberContext, $modSettings, $user_info, $color_profile;

Replace with:
Code: [Select]
function sp_userInfo($parameters, $id, $return_parameters = false)
{
global $context, $txt, $scripturl, $memberContext, $modSettings, $user_info, $color_profile, $boardurl;

<<<>>>

Within the same function, find:
Code: [Select]
if (!empty($member_info['avatar']['image']))
                    echo '
', $member_info['avatar']['image'], '<br /><br />';

Add the following BEFORE the above code:
Code: [Select]
if (empty($member_info['avatar']['image']))
   {
$member_info['avatar']['image'] = '<img src="' . $boardurl.'/Themes/default/images/default_avatar.png" alt="Default Avatar" title="Default Avatar" width="90" height="90" />';

   }

<<<<<<<<<<>>>>>>>>>>

Change the dimensions of the avatar to what you want within the above edit. The image must be named:

... and must be placed in your / Themes / default / images    folder.

UD



Title: Re: Poll Block
Post by: ccbtimewiz on February 10, 2010, 12:30:33 AM
You could just make it an inline check

Eg, instead of:

Code: [Select]
if (!empty($member_info['avatar']['image']))
                             echo '
                           ', $member_info['avatar']['image'], '<br /><br />';

You'd have:
Code: [Select]
echo (!empty($member_info['avatar']['image']) ? $member_info['avatar']['image'] : '<img src="' . $settings['default_images_url'] . '/default_avatar.png" alt="Default Avatar" title="Default Avatar" width="90" height="90" />'), '<br /><br />';
In addition, you don't need to add the $boardurl global in my case either. You would need to add $settings however.
Title: Re: Poll Block
Post by: [SiNaN] on February 27, 2010, 05:43:36 AM
Did the suggested solutions above helped, curlin?
Title: Re: Poll Block
Post by: curlin on February 27, 2010, 02:22:21 PM
Did the suggested solutions above helped, curlin?

     Yes, works fine now  :)
Title: Re: Poll Block
Post by: 130860 on March 26, 2010, 05:29:41 PM
For some reason SSI.php still didn't work. So I modified poll block to use ?action=vote instead of SSI pollVote.




sorry to bump this but a spanish user is having the exact same error with a poll block  it goes to SSI.php?ssi_function=pollVote   and gives a 500 error   even in the ssi_examples.php   so I was wondering how do you chage the SSI.php?ssi_function=pollVote   for  action=vote;topic=x;poll=x; ?
SimplePortal 2.3.8 © 2008-2024, SimplePortal