Project / Support Center
Welcome, Guest. Please login or register. September 29, 2021, 03:19: AM
Home Help Search Login Register
D-Web Web Site Creator D - Web Web Site Creator On-line HTML Editor No Programming knowledge required. Web Global Net PayPal-Cart Shopping Cart System PayPal - Kart Shopping Cart System for E-Commerce over the internet, that's easy to use. Web Global Net Newsletter Manager Newsletter Manager On-line Newsletter Creator with Email Subscriber Management.
Ring Central Discount
Web Global Net Web Application & Web Development Project Center  |  Technical Issues  |  FCK/CKEditor  |  Topic: making the image directory dynamic 0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Send this topic Print
Author Topic: making the image directory dynamic  (Read 7230 times)
admin
Guest
« on: August 17, 2010, 05:35: PM »

ok here is what I did - maybe not the best way but it works and that is all I cared about.

This only works if you use a session variable because there is no way to grab a URL - that we can figure out

In the /ckfinder/config.php

First included the connection file on the first line of the page

<?php include("association.php"); ?> For some reason Require Once did not work.

You need to start the session do it like this

<?php include("association.php"); ?>
<?php
session_start();
/*
 * ### CKFinder : Configuration File - Basic Instructions

I then created the record set at the beginning of the file using dreamweaver which created the session variable I needed, tip though move the connection file to the ckfinder directory first.

Next I moved all this code that Dreamweaver created :

CODE: SELECT ALL
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

$colname_rsownid = "-1";
if (isset($_SESSION['own_id'])) {
  $colname_rsownid = $_SESSION['own_id'];
}
mysql_select_db($database_association, $association);
$query_rsownid = sprintf("SELECT * FROM associations WHERE assoc_id = %s", GetSQLValueString($colname_rsownid, "int"));
$rsownid = mysql_query($query_rsownid, $association) or die(mysql_error());
$row_rsownid = mysql_fetch_assoc($rsownid);
$totalRows_rsownid = mysql_num_rows($rsownid);



To just above the $baseUrl setting

Next I set this as follows

$baseUrl = '/assets/assoc/'.$_SESSION['own_id'].'/';

and the $baseDir as follows

$baseDir = '/home/assoc/public_html/assets/assoc/'.$_SESSION['own_id'].'/';



at the beginning of the file like this

<?php include("association.php"); ?>
<?php
session_start();
/*
 * ### CKFinder : Configuration File - Basic Instructions


at the bottom of the file make sure your place the mysql_free_result as shown below

$config['plugin_imageresize']['largeThumb'] = '180x180';

mysql_free_result($rsad);
« Last Edit: October 04, 2012, 10:20: PM by Web Global Net » Report to moderator   Logged
Pages: [1] Go Up Send this topic Print 
Web Global Net Web Application & Web Development Project Center  |  Technical Issues  |  FCK/CKEditor  |  Topic: making the image directory dynamic « previous next »
Jump to:  


Login with username, password and session length
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!