We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30625
    • 19 Posts
    @tracyjs

    better make a plugin.
    Check systemconfiguration:
    OnWebPageInit
    OnWebAuthentication
    OnManagerAuthentication
    OnModFormRender

    put this in you plugin text:
    function ConnectMy()
    {
        global $db;
        $db = mysql_connect("localhost", "username", "password") or die("Can't connect to database (MySQL).");
        }
    


    from that moment on you can user
    ConnectMy();
    on every snippet or module (even other plugin) to connect to your db.
    expand the plugin with some other features and you can use that also.

    i created a complete class and can use it from wherever.

    i even connect to different dbs
    function ConnectMS()
    {
        global $dbm;
        $dbm = mssql_connect("myserver70", "user", "pw") or die("Can't connect to database (MS-SQL).");
    }
    
    
    function ConnectMy()
    {
        global $db;
        $db = mysql_connect("localhost", "user", "pw") or die("Can't connect to database (MySQL).");
        }
    
    function ConnectMy2()
    {
        global $db;
        $db = mysql_connect("localhost", "root", "pw") or die("Can't connect to database (MySQL).");
        }
    
    function ConnectOra()
    {
        global $db;
        $db = oci_connect("user", "pw", "//IP") or die("Can't connect to database (Oracle).");
        $sql_timestamp_set = "ALTER SESSION SET NLS_TIMESTAMP_FORMAT = 'DD-MM-YYYY HH24:MI:SS'";
        $do = oci_parse($db, $sql_timestamp_set);
        oci_execute($do);
        $sql_date_set = "ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MM-YYYY HH24:MI:SS'";
        $do = oci_parse($db, $sql_date_set);
        oci_execute($do);
        $sql_schema = "alter session set current_schema = schemaname";
        $do = oci_parse($db, $sql_schema);
        oci_execute($do);
        return $db;
        }
    

      no mail. no icq, no aim, no msn, no yim, no sms, no phone, no fax, no telex, no satellite.... just yell smiley
      • 42842
      • 12 Posts
      Hi guys!

      My Question is related to this here so I post it here:
      I want to display this content: http://heartandtruelove.com/vimeo.php?id=123456

      So i created the php into a snippet:
      <?php
      $imgid = $_GET['id'] . $id;
      $hash = unserialize(file_get_contents("http://vimeo.com/api/v2/video/$imgid.php"));
      echo $hash[0]['thumbnail_medium'];
      ?>
      

      and i can load the snippet like this:
      [[!vimeo_thumb? &id=`123456`]]

      BUT, here comes the problem, I don't get the same thumbnail link like here:
      http://heartandtruelove.com/vimeo.php?id=123456

      My guess was, that I am doing something wrong in the php code, what could it be?
      thanks for fast response! =)