Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Post Installation Help
Author Message
Susann
Moderator


Joined: Dec 19, 2004
Posts: 3191
Location: Germany:Moderator German NukeSentinel Support

PostPosted: Mon Sep 05, 2005 5:44 am Reply with quote

Is there an easy way to to make survey´s in english and in other languages at the same time ?

We have started a survey in German till the end of the year.

Therefore the english site displays for the survey block:

There isn't content right now for this block.


Last edited by Susann on Fri Oct 21, 2005 7:19 am; edited 1 time in total 
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 17077

PostPosted: Fri Sep 09, 2005 12:23 pm Reply with quote

Why not just code the options in both languages at the same time? In other words, ask the question in both languages. Then, in the options, code them in both languages. Let's say (since my German is almost nil) that you could answer Yes or No. Your options would show
Do you speak German? - Sprechen Sie Deutsches?
Yes (Ja)
No (Nein)

Anyway, you get my meaning I'm sure Laughing
 
View user's profile Send private message
Susann
PostPosted: Fri Sep 09, 2005 4:28 pm Reply with quote

Your solution is very clever and definitely multilingual . Laughing

But I would like to have 2 different surveys.The German block is called "Umfrage" and the Englisch block "Surveys" or "Vote" and of course with other questions.
If there are too many English words on the German site it could be a problem for some search engines. But I will think over different solutions.


Btw:Sprechen Sie Deutsch ?


Last edited by Susann on Fri Sep 09, 2005 4:32 pm; edited 1 time in total 
Raven
PostPosted: Fri Sep 09, 2005 4:30 pm Reply with quote

You will need to create another Survey block with corresponding tables. That is really the easiest and quickest way.
 
Susann
PostPosted: Thu Oct 20, 2005 6:40 pm Reply with quote

Our new survey is multilingual but I´m wondering it´s not possible to show this block in all languages.I have checked Only registered users can see links on this board! Get registered or login! and his survey block works well in all languages.

When I create a new survey in nuke 6.5 I can only choose between English, French or German. The settings in the administration for this block is for all visitors and all languages.

But still"there isn´t content right now for this block". Really, I hate this sentence.
How can I get this survey working on the English and French part of our website ?

Only registered users can see links on this board! Get registered or login!
 
Nukeum66
Life Cycles Becoming CPU Cycles


Joined: Jul 30, 2003
Posts: 551
Location: Neurotic, State, USA

PostPosted: Fri Oct 21, 2005 5:59 am Reply with quote

Well, my Survey block is just the standard block that ships with 7.6.3.0. If you think it may help you here is the code.
Code:
<?php


/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2002 by Francisco Burzi                                */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
/*         Additional security & Abstraction layer conversion           */
/*                           2003 chatserv                              */
/*      http://www.nukefixes.com -- http://www.nukeresources.com        */
/************************************************************************/

if ( !defined('BLOCK_FILE') ) {
    Header("Location: ../index.php");
    die();
}

global $prefix, $multilingual, $currentlang, $db, $boxTitle, $content, $pollcomm, $user, $cookie;

if ($multilingual == 1) {
    $querylang = "WHERE planguage='$currentlang' AND artid='0'";
} else {
    $querylang = "WHERE artid='0'";
}

$row = $db->sql_fetchrow($db->sql_query("SELECT pollID FROM ".$prefix."_poll_desc $querylang ORDER BY pollID DESC LIMIT 1"));
$pollID = intval($row['pollID']);
if ($pollID == 0 || $pollID == "") {
    $content = "";
} else {
    if (!isset($url)) {
   $url = sprintf("modules.php?name=Surveys&amp;op=results&amp;pollID=%d", $pollID);
    }
    $content = "<form action=\"surveys.html\" method=\"post\">";
    $content .= "<input type=\"hidden\" name=\"pollID\" value=\"".$pollID."\">";
    $content .= "<input type=\"hidden\" name=\"forwarder\" value=\"".$url."\">";
    $row2 = $db->sql_fetchrow($db->sql_query("SELECT pollTitle, voters FROM ".$prefix."_poll_desc WHERE pollID='$pollID'"));
    $pollTitle = $row2['pollTitle'];
    $voters = intval($row2['voters']);
    $boxTitle = _SURVEY;
    $content .= "<font class=\"content\"><b>$pollTitle</b></font><br><br>\n";
    $content .= "<table border=\"0\" width=\"100%\" summary=\"survey_table1\">";
    for($i = 1; $i <= 12; $i++) {
   $row3 = $db->sql_fetchrow($db->sql_query("SELECT pollID, optionText, optionCount, voteID FROM ".$prefix."_poll_data WHERE (pollID='$pollID') AND (voteID='$i')"));
   if(isset($row3)) {
       $optionText = $row3['optionText'];
       if ($optionText != "") {
      $content .= "<tr><td valign=\"top\"><input type=\"radio\" name=\"voteID\" value=\"".$i."\"></td><td width=\"100%\"><font class=\"content\">$optionText</font></td></tr>\n";
       }
   }
    }
    $content .= "</table><br><center><font class=\"content\"><input type=\"submit\" value=\""._VOTE."\"></font><br>";
    if (is_user($user)) {
   cookiedecode($user);
    }
    for($i = 0; $i < 12; $i++) {
   $row4 = $db->sql_fetchrow($db->sql_query("SELECT optionCount FROM ".$prefix."_poll_data WHERE (pollID='$pollID') AND (voteID='$i')"));
   $optionCount = intval($row4['optionCount']);
   $sum = (int)$sum+$optionCount;
    }
    $content .= "<br><font class=\"content\"><a href=\"modules.php?name=Surveys&amp;op=results&amp;pollID=$pollID&amp;mode=$cookie[4]&amp;order=$cookie[5]&amp;thold=$cookie[6]\"><b>"._RESULTS."</b></a><br><a href=\"surveys.html\"><b>"._POLLS."</b></a><br>";

    if ($pollcomm) {
   $numcom = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_pollcomments WHERE pollID='$pollID'"));
   $content .= "<br>"._VOTES.": <b>$sum</b> <br> "._PCOMMENTS." <b>$numcom</b>\n\n";
    } else {
   $content .= "<br>"._VOTES." <b>$sum</b>\n\n";
    }
    $content .= "</font></center></form>\n\n";
}

?>

_________________
Scott Johnson MIS Ubuntu/Linux 11.10 
View user's profile Send private message Visit poster's website
Susann
PostPosted: Fri Oct 21, 2005 6:23 am Reply with quote

Thanks for the code.
I like your new design. Smile
I ´ll check it, but I´m interested what planguage is in your table nuke_poll_desc. I have set this to german maybe it´s wrong ?
 
Nukeum66
PostPosted: Fri Oct 21, 2005 6:37 am Reply with quote

english
 
Susann
PostPosted: Fri Oct 21, 2005 7:08 am Reply with quote

Thanks again. I just tried your code gaves me a never ending loop. But I ´ll go through the code to find the difference. Maybe I try a survey block from 6.9.
If I set the languages to english I have on the main page my latest survey and on the english page the newest survey. It´s not the solotion.
 
Nukeum66
PostPosted: Fri Oct 21, 2005 7:16 am Reply with quote

Sorry I did not mean for you to use the block code as a replacement, but rather as a refference..... Smile I'll have more time this evening to try and help you sort through this problem, but for now I'm off to work..... Sad
 
Susann
PostPosted: Fri Oct 21, 2005 7:50 pm Reply with quote

I tried today the 6.9 index.php and the block from nuke 6.9 and I added the missing french language file into the folder.
Changed also the first lines of your code afterthat your code works without loop but still the same empty content for the english and french survey block. Confused

Do you have any other ideas ?
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Post Installation Help

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©