Advertisement
Guest User

Untitled

a guest
Aug 26th, 2017
445
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.67 KB | None | 0 0
  1. <?php
  2. /*
  3.  * Created 10-2016 by Marcel Minke (marcel.minke@limesurvey.org)
  4.  *
  5.  * This script creates an overview of different translations
  6.  */
  7.     /*
  8.      * ------------ START CONFIGURATION --------------
  9.      */
  10.  
  11.     //set the survey language (usually "de") for output
  12.     $lang = "de";
  13.  
  14.     /*
  15.      * ------------ END CONFIGURATION --------------
  16.      */
  17.  
  18. /*
  19.  * ------------ START WORKFLOW --------------
  20.  */
  21.  
  22.  
  23. //error reporting
  24. //ini_set('display_errors',1);
  25. //error_reporting(E_ALL  & ~E_NOTICE);
  26.  
  27. include_once './yiiInstantiate.php';
  28.  
  29. Yii::import('application.helpers.common_helper', true);
  30.  
  31. // Push all config details (config.details returns them as array) into this a rray
  32. $config = require_once("../application/config/config.php");
  33. // DB CONNECTION DETAILS
  34. $databaseUsername = $config['components']['db']['username'];
  35. $databasePassword = $config['components']['db']['password'];
  36. $dbprefix = $config['components']['db']['tablePrefix'];
  37. // The DB connection string looks like this:
  38. // 'mysql:host=localhost;port=3306;dbname=etcvps88_devm;'
  39. // so we need to check for the last "=", add 1 and get the string without the ending ";" character:
  40. $databaseName = substr($config['components']['db']['connectionString'],strrpos($config['components']['db']['connectionString'],"=")+1,-1);
  41.  
  42. $connect = mysqli_connect("localhost", $databaseUsername, $databasePassword, $databaseName);
  43.  
  44.    
  45. //fake survey ID for initialisation
  46. $sid = 123456;
  47. setYiiLang(NULL, $sid);
  48.  
  49. //check if SURVEYID was passed
  50. if(isset($_GET['sid']) && $_GET['sid'] != "")
  51. {
  52. $sid = intval($_GET['sid']);
  53. $fieldmap = createFieldMap($sid,'full',false,false,$lang);
  54.  
  55. //output fieldmap for testing here
  56. }
  57.  
  58. //END
  59. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement