collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 264
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

NEED HELP? If you're looking for support with Simple Portal, look no further than the Support Board!

Author Topic: Poll Block  (Read 12968 times)

0 Members and 1 Guest are viewing this topic.

Offline curlin

  • Jr. Member
  • **
  • Posts: 52
  • Gender: Male
    • Thoroughbred Junkie
  • SMF Version: 2 RC2
  • SP Version: 2.3.1
Re: Poll Block
« Reply #20 on: January 29, 2010, 01:54:44 AM »
    If it cannot be done then just say so and i'll have to remove it  :(
Hoss Talk At Thoroughbred Junkie

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Poll Block
« Reply #21 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.

And slowly, you come to realize... It's all as it should be...

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Poll Block
« Reply #22 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.
And slowly, you come to realize... It's all as it should be...

Offline curlin

  • Jr. Member
  • **
  • Posts: 52
  • Gender: Male
    • Thoroughbred Junkie
  • SMF Version: 2 RC2
  • SP Version: 2.3.1
Re: Poll Block
« Reply #23 on: January 29, 2010, 12:22:28 PM »
     Yes, and again Thank You  ;D
Hoss Talk At Thoroughbred Junkie

Offline curlin

  • Jr. Member
  • **
  • Posts: 52
  • Gender: Male
    • Thoroughbred Junkie
  • SMF Version: 2 RC2
  • SP Version: 2.3.1
Re: Poll Block
« Reply #24 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;
Hoss Talk At Thoroughbred Junkie

Offline Chen Zhen

  • The Underdog
  • Operations Manager
  • *
  • Posts: 1350
  • Gender: Male
  • Kinesis
    • WebDev
  • SMF Version: 2.1
  • EhPortal Version: 1.22
Re: Poll Block
« Reply #25 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:
  • default_avatar.png

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

UD




Offline ccbtimewiz

  • Hero Member
  • *****
  • Posts: 2185
  • Gender: Male
  • $("div.content:dd").hide();
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
  • EhPortal Version: None
Re: Poll Block
« Reply #26 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.

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Poll Block
« Reply #27 on: February 27, 2010, 05:43:36 AM »
Did the suggested solutions above helped, curlin?
And slowly, you come to realize... It's all as it should be...

Offline curlin

  • Jr. Member
  • **
  • Posts: 52
  • Gender: Male
    • Thoroughbred Junkie
  • SMF Version: 2 RC2
  • SP Version: 2.3.1
Re: Poll Block
« Reply #28 on: February 27, 2010, 02:22:21 PM »
Did the suggested solutions above helped, curlin?

     Yes, works fine now  :)
Hoss Talk At Thoroughbred Junkie

Offline 130860

  • Super Handsome Language Coordinator
  • Comrade
  • *
  • Posts: 1769
  • Gender: Male
  • You and I are not the same class of pirate!
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Poll Block
« Reply #29 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; ?