hello
i hope this is the place for my qustion
I want the visitors to embed polls in to thier sites
embed space beside polls Like the following image
____________________________________________________________
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg404.imageshack.us%2Fimg404%2F2612%2F44203438wt6.jpg&hash=ce0330723323dce10aba6fd9876d28a44d271cfb)
____________________________________________________________
then visitor of my site can copy & paste this code to his site and get poll in his site Like the following image
____________________________________________________________
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg521.imageshack.us%2Fimg521%2F198%2F16541680uq2.jpg&hash=01edd4930baa8b732b52a5e8e9aa0e1c0266cba2)
____________________________________________________________
when his visitors vote the result shown in my forum like the following image
____________________________________________________________
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg521.imageshack.us%2Fimg521%2F1827%2F54973830ui2.jpg&hash=32e9867288d76fff1301d56968209863f7db99eb)
____________________________________________________________
I hope there is mod or plugin for that
if there is not plugin or mod for that how can i do this ?
thanx in advance
I can't see the "embed" image... it's too small.
I have also never specifically seen that as a mod.
The display of the poll looks like a TinyPortal block...
the results is standard smf.
i made it with photoshop it just say the concept
so no solution to this problem ??
i want it
i am ready to pay money to who do it
I still do not understand.
What do you expect the "embed" section to do?
I have already told you that the poll display can be done with TinyPortal and the results display is standard SMF functionality.
If i understood. He need this code that other users can embed to their page.
Quote from: DonGiovanni on September 01, 2008, 03:07:14 PM
If i understood. He need this code that other users can embed to their page.
yes you are right i need users to copy and paste code to embed poll to their page
what is TinyPortal >> sorry i am beginner
i am ready to pay money to anyone who ready to solve this problem for me
wait... you want a code to allow other users to post your forums polls on other pages?
Nope. can not do it. SMF is not designed to be used that way.
Quote from: Kindred on September 01, 2008, 06:23:48 PM
wait... you want a code to allow other users to post your forums polls on other pages?
Nope. can not do it. SMF is not designed to be used that way.
this is not agree with smf license ?
it has nothing to do with the license.
SMF is not programatically designed to be used across multiple sites. Even SSI function only work on the same server/main domain.
Quote from: Kindred on September 01, 2008, 07:15:10 PM
it has nothing to do with the license.
SMF is not programatically designed to be used across multiple sites. Even SSI function only work on the same server/main domain.
so programmers can't do this ?
i will clear what i want to do
may be there is miss understand
lets say i Have
website "A" >> run smf
another "B" >> this is the external websites that users will embed the polls there
when the webmaster take code from "A" he put it in "B"
Then visitors of "B" will just choose from poll choices then click vote when they click vote they go to results in "A"
may be now you understand me
i think this is easy fr programmers
and the answer is NO, it is not easy for programmers. SMF is not intended to be used like that and has no functionality for embedding polls into another site, nor for collecting the data from that site.
SMF is a forum that is intended to be run on a single site/domain. Although you can display posts, etc via RSS, there is no way to send back data.
My first impression was that you wanted to do this all from within your site. Now that you have explained, I will tell you that it can not be easily done... if it can be done at all.
can we do it as iframe ?
smf does not work in iframes
just the poll that will be in Ifram not all the forums
just when vistor click on vote he will go to smf
Quote from: Kindred on September 02, 2008, 07:50:48 AM
smf does not work in iframes
the poll is part of smf.
I will say again...
Quote from: Kindred on September 01, 2008, 07:58:22 PM
and the answer is NO, it is not easy for programmers. SMF is not intended to be used like that and has no functionality for embedding polls into another site, nor for collecting the data from that site.
SMF is a forum that is intended to be run on a single site/domain. Although you can display posts, etc via RSS, there is no way to send back data.
In other words, you CAN NOT do what you are asking, without MAJOR coding.
what is major coding ?
you mean paid one i am ready for this
where i can find coder for this ?
If you can find a coder... go for it. good luck.
When I say major coding, I mean that I expect that you will need a professional programmer who will have to re-write major portions of code.
basically, SMF's current design does not support what you are trying to do.
You just need a form with the correct information Kindred. You can do it, but note that guests cannot vote in polls in SMF 1.1.5.
../Themes/default/Display.template.php
Find:
echo '
<table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder" style="padding-top: 0; margin-bottom: 2ex;">
<tr>
<td class="titlebg" colspan="2" valign="middle" style="padding-left: 6px;">
<img src="', $settings['images_url'], '/topic/', $context['poll']['is_locked'] ? 'normal_poll_locked' : 'normal_poll', '.gif" alt="" align="bottom" /> ', $txt['smf43'], '
</td>
Replace:
$embed = '
<form action="' . $scripturl . '?action=vote;topic=' . $context['current_topic'] . '.' . $context['start'] . ';poll=' . $context['poll']['id'] . '" method="post" accept-charset="' . $context['character_set'] . '" style="margin: 0px;">
<table>
<tr>
<td colspan="2">';
if ($context['poll']['allowed_warning'])
$embed .= '
' . $context['poll']['allowed_warning'] . '
</td>
</tr><tr>
<td>';
foreach ($context['poll']['options'] as $option)
$embed .= '
' . $option['vote_button'] . ' ' . $option['option'] . '<br />';
$embed .= '
</td>
<td valign="bottom" style="padding-left: 15px;">';
$embed .= '
</td>
</tr><tr>
<td colspan="2"><input type="submit" value="' . $txt['smf23'] . '" /></td>
</tr>
</table>
</form>';
$embed = htmlspecialchars($embed);
echo '
<table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder" style="padding-top: 0; margin-bottom: 2ex;">
<tr>
<td class="titlebg" colspan="2" valign="middle" style="padding-left: 6px;">
<img src="', $settings['images_url'], '/topic/', $context['poll']['is_locked'] ? 'normal_poll_locked' : 'normal_poll', '.gif" alt="" align="bottom" /> ', $txt['smf43'], '
</td>
<td class="titlebg" valign="middle" style="padding-left: 6px;">
Embed
</td>
Find:
echo '
</td>
</tr>
</table>';
Replace:
echo '
</td>
<td class="windowbg">
<textarea rows="5" style="width: 400px;">' . $embed . '</textarea>
</td>
</tr>
</table>';
Also, in SMF 2.0, guests can also vote in polls. It will be better idea to use this with SMF 2.0.
Quote from: Kindred on September 01, 2008, 10:11:34 AM
I can't see the "embed" image... it's too small.
What?
The pics are pretty big, just this forum has resized them in the post.
[SiNaN],
You missed the point.... Cong wants that form to be used on OTHER sites. The change that you made will change the display of the poll on the smf site itself... it won't allow him to post an SMF poll as a block on another site.
:)
Well, if I get things correctly, it will.
I've created a poll. Then on display template, there is poll shown and there is an embed code.
See how I produce the embed code:
$embed = '
<form action="' . $scripturl . '?action=vote;topic=' . $context['current_topic'] . '.' . $context['start'] . ';poll=' . $context['poll']['id'] . '" method="post" accept-charset="' . $context['character_set'] . '" style="margin: 0px;">
<table>
<tr>
<td colspan="2">';
if ($context['poll']['allowed_warning'])
$embed .= '
' . $context['poll']['allowed_warning'] . '
</td>
</tr><tr>
<td>';
foreach ($context['poll']['options'] as $option)
$embed .= '
' . $option['vote_button'] . ' ' . $option['option'] . '<br />';
$embed .= '
</td>
<td valign="bottom" style="padding-left: 15px;">';
$embed .= '
</td>
</tr><tr>
<td colspan="2"><input type="submit" value="' . $txt['smf23'] . '" /></td>
</tr>
</table>
</form>';
$embed = htmlspecialchars($embed);
Here is a sample of an embed code displayed in the topic besides poll options:
<form action="http://127.0.0.1/smf/index.php?action=vote;topic=7.0;poll=1" method="post" accept-charset="ISO-8859-1" style="margin: 0px;">
<table>
<tr>
<td colspan="2">
<input type="radio" name="options[]" id="options-0" value="0" class="check" /> Choice 1<br />
<input type="radio" name="options[]" id="options-1" value="1" class="check" /> Choice 2<br />
<input type="radio" name="options[]" id="options-2" value="2" class="check" /> Choice 3<br />
</td>
<td valign="bottom" style="padding-left: 15px;">
</td>
</tr><tr>
<td colspan="2"><input type="submit" value="Submit Vote" /></td>
</tr>
</table>
</form>
When you use that embed code on a usual html page, it will work. The point is, just you post the info to action=vote.
hmmmm..... maybe I was wrong.
Of course, if guests can't vote, this won't work.
[SiNaN] you are great
Thank you very very much
you made me back to light
I tried with my 1.1.5 but guests can't vote but i need gusts to vote and i got many error message
so i download smf 2 now to test your tip on it
i will back and reply you when i test it on smf 2
hey thank you very much sinan
you are very good
thank you also Kindred
The problem is solved
Glad you get it solved. You're welcome. :)
your tip is worked good but i found out small problem
i can't see poll question after embed code to external sit ( see the following image )
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg154.imageshack.us%2Fimg154%2F455%2Fz1sn4.jpg&hash=bb062bf12af7e9f5b0e0f7f81122697d882aa377) (http://imageshack.us)
please sinan or any body reply me
We will, but you should a bit more patient. You know we are all valunteers here and trying to do our best. Bumping topics unless 24 hours passed from the last reply to topic is not a good idea really. :)
The codes I gave was for SMF 1.1.5. I thin you are trying to use them in SMF 2.0. Here what you should use in 2.0;
../Themes/default/Display.template.php
Find:
echo '
<table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder" style="padding-top: 0; margin-bottom: 2ex;">
<tr>
<td class="titlebg" colspan="2" valign="middle" style="padding-left: 6px;">
<img src="', $settings['images_url'], '/topic/', $context['poll']['is_locked'] ? 'normal_poll_locked' : 'normal_poll', '.gif" alt="" align="bottom" /> ', $txt['poll'], '
</td>
Replace:
$embed = '
<table>
<tr>
<td>
' . $context['poll']['question'] . '
<form action="' . $scripturl . '?action=vote;topic=' . $context['current_topic'] . '.' . $context['start'] . ';poll=' . $context['poll']['id'] . '" method="post" accept-charset="' . $context['character_set'] . '" style="margin: 0px;">
<table>
<tr>
<td colspan="2">
' . ($context['poll']['allowed_warning'] ? $context['poll']['allowed_warning'] . '
</td>
</tr><tr>
<td>' : '');
foreach ($context['poll']['options'] as $option)
$embed .= '
' . $option['vote_button'] . ' <label for="' . $option['id'] . '">' . $option['option'] . '</label><br />';
$embed .= ' </td>
<td valign="bottom" style="padding-left: 15px;">
</td>
</tr><tr>
<td colspan="2"><input type="submit" value="' . $txt['poll_vote'] . '" /></td>
</tr>
</table>
</form>
</td>
</tr>
</table>';
$embed = htmlspecialchars($embed);
echo '
<table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder" style="padding-top: 0; margin-bottom: 2ex;">
<tr>
<td class="titlebg" colspan="2" valign="middle" style="padding-left: 6px;">
<img src="', $settings['images_url'], '/topic/', $context['poll']['is_locked'] ? 'normal_poll_locked' : 'normal_poll', '.gif" alt="" align="bottom" /> ', $txt['poll'], '
</td>
<td class="titlebg" valign="middle" style="padding-left: 6px;">
Embed
</td>
Find:
echo '
</td>
</tr>
</table>';
Replace:
echo '
</td>
<td class="windowbg">
<textarea rows="5" style="width: 400px;">' . $embed . '</textarea>
</td>
</tr>
</table>';
ok thank you very much i saw you online put i didn't pm u as you said in your sig
so now i c what u say
thank you very much for your great help
Check out JS-Kit.com (http://js-kit.com). You can copy and paste their scripts in between HTML tags. [ html] [ /html] This is the easiest way I think.
1- this is an old post that has already been solved
2- you didn't read... he wants to post SMF polls from his forum on OTHER sites.
Quote from: [SiNaN] on September 05, 2008, 07:34:21 PM
We will, but you should a bit more patient. You know we are all valunteers here and trying to do our best. Bumping topics unless 24 hours passed from the last reply to topic is not a good idea really. :)
The codes I gave was for SMF 1.1.5. I thin you are trying to use them in SMF 2.0. Here what you should use in 2.0;
../Themes/default/Display.template.php
Find:
echo '
<table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder" style="padding-top: 0; margin-bottom: 2ex;">
<tr>
<td class="titlebg" colspan="2" valign="middle" style="padding-left: 6px;">
<img src="', $settings['images_url'], '/topic/', $context['poll']['is_locked'] ? 'normal_poll_locked' : 'normal_poll', '.gif" alt="" align="bottom" /> ', $txt['poll'], '
</td>
Replace:
$embed = '
<table>
<tr>
<td>
' . $context['poll']['question'] . '
<form action="' . $scripturl . '?action=vote;topic=' . $context['current_topic'] . '.' . $context['start'] . ';poll=' . $context['poll']['id'] . '" method="post" accept-charset="' . $context['character_set'] . '" style="margin: 0px;">
<table>
<tr>
<td colspan="2">
' . ($context['poll']['allowed_warning'] ? $context['poll']['allowed_warning'] . '
</td>
</tr><tr>
<td>' : '');
foreach ($context['poll']['options'] as $option)
$embed .= '
' . $option['vote_button'] . ' <label for="' . $option['id'] . '">' . $option['option'] . '</label><br />';
$embed .= ' </td>
<td valign="bottom" style="padding-left: 15px;">
</td>
</tr><tr>
<td colspan="2"><input type="submit" value="' . $txt['poll_vote'] . '" /></td>
</tr>
</table>
</form>
</td>
</tr>
</table>';
$embed = htmlspecialchars($embed);
echo '
<table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder" style="padding-top: 0; margin-bottom: 2ex;">
<tr>
<td class="titlebg" colspan="2" valign="middle" style="padding-left: 6px;">
<img src="', $settings['images_url'], '/topic/', $context['poll']['is_locked'] ? 'normal_poll_locked' : 'normal_poll', '.gif" alt="" align="bottom" /> ', $txt['poll'], '
</td>
<td class="titlebg" valign="middle" style="padding-left: 6px;">
Embed
</td>
Find:
echo '
</td>
</tr>
</table>';
Replace:
echo '
</td>
<td class="windowbg">
<textarea rows="5" style="width: 400px;">' . $embed . '</textarea>
</td>
</tr>
</table>';
This solution not working now after upgrade to the latest version SMF 2.0 Beta 4
i can't find now the codes in Display.template.php
so may be the solution need update
thank you in advance
I found the difference between the latest two versions in things like
<h3 class="titlebg headerpadding">
instead of
<td class="titlebg" colspan="2" valign="middle" style="padding-left: 6px;">
but i am newbie to php and smf
so plz anyone modify sinan reply
http://www.simplemachines.org/community/index.php?topic=258947.msg1691993#msg1691993 (http://www.simplemachines.org/community/index.php?topic=258947.msg1691993#msg1691993)
to be working with the latest version SMF 2.0 Beta 4
plz i need it
please anyone tell me if my problem with the latest version is not understood
Please, do not bump your topics unless 24 hours passed from the last reply.
Display.template.php
Find:
echo '
</div>
</div>';
}
// Does this topic have some events linked to it?
Replace:
echo '
</div>
<h3 class="titlebg headerpadding">
<img src="', $settings['images_url'], '/topic/', $context['poll']['is_locked'] ? 'normal_poll_locked' : 'normal_poll', '.gif" alt="" align="bottom" />Embed Codes
</h3>
<div class="windowbg clearfix" id="poll_options">
', $embed,'
</div>
</div>';
}
// Does this topic have some events linked to it?
Find:
if ($context['is_poll'])
{
Replace:
if ($context['is_poll'])
{
$embed = '
<table>
<tr>
<td>
' . $context['poll']['question'] . '
<form action="' . $scripturl . '?action=vote;topic=' . $context['current_topic'] . '.' . $context['start'] . ';poll=' . $context['poll']['id'] . '" method="post" accept-charset="' . $context['character_set'] . '" style="margin: 0px;">
<table>
<tr>
<td colspan="2">
' . ($context['poll']['allowed_warning'] ? $context['poll']['allowed_warning'] . '
</td>
</tr><tr>
<td>' : '');
foreach ($context['poll']['options'] as $option)
$embed .= '
' . $option['vote_button'] . ' <label for="' . $option['id'] . '">' . $option['option'] . '</label><br />';
$embed .= ' </td>
<td valign="bottom" style="padding-left: 15px;">
</td>
</tr><tr>
<td colspan="2"><input type="submit" value="' . $txt['poll_vote'] . '" /></td>
</tr>
</table>
</form>
</td>
</tr>
</table>';
$embed = htmlspecialchars($embed);
thank u mr sinan for your reply but there is a problem
the code doesn't shown in scrolled textarea like the previous solution
you can see this image to state the problem
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg125.imageshack.us%2Fimg125%2F6808%2F75730934cr9.jpg&hash=6e6baf768f7eab361c1136ca2ee46010d3533532) (http://imageshack.us)
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg125.imageshack.us%2Fimg125%2F75730934cr9.jpg%2F1%2Fw884.png&hash=ab633b2b3f3de5f1139400b2e38171867c4e3fa0) (http://g.imageshack.us/img125/75730934cr9.jpg/1/)
Sorry.
Now,
Find:
', $embed,'
Replace:
<textarea rows="5" style="width: 400px;">', $embed,'</textarea>
thank you sinan
the last thing i want the code to be beside the poll not under the poll
Like the solution you did before in the previous version
as the image shown
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg338.imageshack.us%2Fimg338%2F909%2F16772108to6.jpg&hash=c27956b205d9e56ca0d5d3c772ea6348270dd509) (http://imageshack.us)
(http://g.imageshack.us/img338/16772108to6.jpg/1/)
Okay...
Find:
<div class="tborder marginbottom" id="poll">
Replace:
<table>
<tr>
<td style="width: 100%">
<div class="tborder marginbottom" id="poll">
Find:
echo '
</div>
<h3 class="titlebg headerpadding">
<img src="', $settings['images_url'], '/topic/', $context['poll']['is_locked'] ? 'normal_poll_locked' : 'normal_poll', '.gif" alt="" align="bottom" />Embed Codes
</h3>
<div class="windowbg clearfix" id="poll_options">
<textarea rows="5" style="width: 400px;">', $embed,'</textarea>
</div>
</div>';
Replace:
echo '
</div>
</div>
</td>
<td style="width: 50%;">
<div class="tborder marginbottom" id="poll">
<h3 class="titlebg headerpadding">
<img src="', $settings['images_url'], '/topic/', $context['poll']['is_locked'] ? 'normal_poll_locked' : 'normal_poll', '.gif" alt="" align="bottom" />Embed Codes
</h3>
<div class="windowbg clearfix" id="poll_options">
<textarea rows="5" style="width: 400px;">', $embed,'</textarea>
</div>
</div>
</td>
</tr>
</table>';
the words can't describe how you are very good man
thank you sinan
Guys,
I might be going slightly off-topic, but it is still a question about Polls and related to something that was mentioned earlier in this thread. Here goes:
I just started using smf and I have been unable to give guests the capability to vote in polls. How can I enable this setting? I went to "Admin" -> "Permissions" -> "Permissions By MemberGroup" and there I checked the Guest group checkbox, selected "Vote in polls" and clicked "Set Permissions". This increased my permission count for Guests group from 4 to 5.
However, guests still do not see the radiobuttons in the poll. They can reply to the post/poll itself, but I think that is probably because I checked "Post replies to topics" -> "Any Topic" under Guest membergroup' General Permissions. I suspect that this is related to me not being able see "Vote polls" for Guests (unlike other MemberGroups) under "Polls" just like I see "View polls", "Post polls", "Add poll to topics", etc. Have I set some master permission incorrectly?
I believe I had originally installed 1.1.5 and later upgraded to 1.1.7. This is what I see under "Admin" -> "Administration Center"
Support Information
Version Information:
Forum version: SMF 1.1.7
Current SMF version: SMF 1.1.7
Any help would be appreciated.
Thanks
since the poll records the vote by user, guests can never vote in polls...