Welcome Guest, Not a member yet? Register   Sign In
  Structure advices for remote CMS Project
Posted by: El Forum - 11-01-2008, 12:50 PM - Replies (1)

[eluser]strogg[/eluser]
Hello,

I'm start for developing a CMS (specially like remote hosted project). Purpose is behind for this application is simply ;

"Users can create their sites, can manage their contents with their accounts by login into system, their url's are generated subdomain format
like (user.domain.com)"

So I'm developing frontend & backend parts in these days, I completed CRUD operations (Create,Read,Update,Delete) for users accounts and also for modules.
But I cannot going furtner than because, I faced with some things,

1. I want to separate databases for account (each user must have own db) . Because if I got 1000 user only one database can't handle connections. Maybe Sqlite is better for this type but I'm not experianced on this db. This needs fast and reliable approach for massive traffic and for user base. What is your advice ?

2. Theme support. How can I add themes for users, they can select for their sites. I read some things about templates from blogs, (they are talking about View_Helpers and Layout for specific themes is required). What is best design approach for themes ?

3. I created modular structure for everything.

a. Admin module - handles admin operations
b. Account module - parsing user's themes, settings, contents, etc.
c. News,Article,Video etc modules are seperated.

Is this structure is good for extensebility, and true design apporach for these type of sites ?

4. I wanto give url's to users subdomain like (I know , "domain.com/username" can be convert to" username.domain.com" using CI Route) but this subdomain must get, users template, contents, other configurations right ? How can i do this.?

5. And last one ;

Please check sample successful approachs they already made.
Synthasite.com
Goodbarry.com
Webnode.com

All advices, tips and suggestions are welcome.

Thanks
Marlo.


  Database connection groups
Posted by: El Forum - 11-01-2008, 12:20 PM - Replies (1)

[eluser]Billy Khan[/eluser]
I just want to check to make sure....

If i have two db connection groups ("default" and "db2"), and i make a "db2" object, do i need to reset the connection back to default?

Or when i create the db2 connection, i effectively have two connection objects, i.e.

$this->db->blah
// and
$db2->blah

where i can use one straight after the other in the same method and they both connect to their respective databases.


  Datebase close() function
Posted by: El Forum - 11-01-2008, 11:49 AM - Replies (22)

[eluser]haraldo[/eluser]
Hi there,

i'm currently opening a custom db connection within a hook. Recording a record and then closing the db. Something like below:

Code:
$this->_openDBConn();
// print_r( $this->oDB ) BEFORE
$this->recordVisit();
$this->_closeDBConn();

// print_r( $this->oDB ) AFTER
$this->recordVisit();

This works fine and the record is recorded in the db. No error etc.

However, i make another call to
Code:
$this->recordVisit();
immediatelty after i've closed the db connection. This record is also put in the db even though i've closed the connection correctly.

I know i'm closing it cause i can see i'm getting into the _close() function in the mysql driver. Also in the databse config i've set the following:

Code:
$db['default']['pconnect'] = FALSE;

When i print_r( $this->oDB ) before i get this (exert):

Code:
[pconnect] =>
[conn_id] => Resource id #58

after:

Code:
[pconnect] =>
[conn_id] =>

Why does the second record go in? I would expect to get a PHP error, no? Since the conn_id is empty.

Thanks for any advice.


  ER Design Tool
Posted by: El Forum - 11-01-2008, 10:24 AM - Replies (3)

[eluser]sl3dg3hamm3r[/eluser]
Hey there

I usually start to write the SQL-queries for tables and their relations in notepad. But for documentation-reasons, I'd like to have at the end a graphical view of the whole model.

What tools do you use? In my case, it should be able to interpret the DDL-File (MySql). Are there some good open-source tools for windows?

Sl3dg3


  CI 1.7:if dbprefix is set, "$this->db->select" is trying to add dbprefix to its one of mysql funtion parameter.
Posted by: El Forum - 11-01-2008, 10:18 AM - Replies (3)

[eluser]kirrie[/eluser]
(first, i'm not an english user. so, please be tolerant about my english. Wink)

i'm using CI 1.7.0 and making a bulletin board system with it.
i set dbprefix "m_" in "system/application/config/database.php" and wrote some codes using Active Record Class to get a list of articles.
codes are like this:

Code:
$this->db->select("A.id, A.virtualnumber, A.author, A.subject, COUNT(CM.id) AS commentnumbering, A.count, DATE(A.created) AS created");
$this->db->from("board_article AS A");
$this->db->join("board_config AS C", "A.boardid = C.id");
$this->db->join("board_comment AS CM", "A.id = CM.articleid", "LEFT");
$this->db->where("C.identifier", $boardIdentifier);
$this->db->group_by("A.id");
$this->db->order_by("A.created", "DESC");
$this->db->limit($offset, $limit);
$ret = $this->db->get();

and, i expected query like this:

Code:
SELECT A.id, A.virtualnumber, A.author, A.subject, COUNT(CM.id) AS commentnumbering, A.count, DATE(A.created) AS created
FROM m_board_article AS A
JOIN m_board_config AS C ON A.boardid = C.id
LEFT JOIN m_board_comment AS CM ON A.id = CM.articleid
WHERE C.identifier = "notice"
GROUP BY A.id
ORDER BY A.created DESC
LIMIT 1, 10;

but i couldn't get any results from that. so i debugged it using Profiler Class.
Profiler said:

Code:
SELECT `A`.`id`, `A`.`virtualnumber`, `A`.`author`, `A`.`subject`, `m_COUNT(CM`.`id)` AS commentnumbering, `A`.`count`, `m_DATE(A`.`created)` AS created
FROM (`m_board_article` AS A)
JOIN `m_board_config` AS C ON `A`.`boardid` = `C`.`id`
LEFT JOIN `m_board_comment` AS CM ON `A`.`id` = `CM`.`articleid`
WHERE `C`.`identifier` = 'notice'
GROUP BY `A`.`id`
ORDER BY `A`.`created` DESC
LIMIT 1, 10

you can find what is wrong with this query. see SELECT clause. CI db class added dbprefix to mysql internal function. "m_COUNT(CM.id) AS commentnumbering" and "m_DATE(A.created) AS created" is it.

is it a bug or not?
am i missing something while i'm using this Active Record Class?

thanks.


  can not upload flv file
Posted by: El Forum - 11-01-2008, 09:04 AM - Replies (1)

[eluser]Mitja B.[/eluser]

Code:
$config['upload_path'] = './uploads/MOVIE';
$config['allowed_types'] = 'flv';
$config['max_size']    = '10000';
    
$this->load->library('upload', $config);  
$this->upload->initialize($config);

$field_name = "flamovie";
      
if (!$this->upload->do_upload($field_name))
{          
$uploads = $this->upload->data();  
echo $uploads['file_ext'];

$data['error_fla'] = $this->upload->display_errors('<div class="warning">', '</div>');
                            
$this->load->view('admin/content_add', $data);
return;
}    
else
{
...

echo $uploads['file_ext'] give me .flv but i get all the time error of
The filetype you are attempting to upload is not allowed

what is wrong? if i change allowed_types to jpg and upload jpg works. Problem is only with flv

EDIT

i try this
Code:
// For Debugging
echo "Mime uploaded: ".$this->upload->file_type."<br>";
foreach ($this->upload->allowed_types as $val)
{
echo "allowed: "; var_dump($this->upload->mimes_types(strtolower($val))); echo "<br>";
}

and i get

Mime uploaded: application/octet-stream
allowed:

boolean false


  Selecting views
Posted by: El Forum - 11-01-2008, 08:48 AM - Replies (4)

[eluser]no_Ob[/eluser]
Hi there

I have got a very annoying problem which is looks like quite simple,but I can't figure it out.

I would like to choose the loaded view according to the database results.

Controller:

Code:
class Categories extends Controller {


    function index()
        {
         parent::Controller();
        
         $this->load->view('index');
         $this->load->view('partial/home_view');    
          $this->load->view('index2');    
            
        }

    function choice($platform,$what)
    {
        parent::Controller();
        
        $data['platform'] = $platform;
        $data['what'] = $what;
        
        
        $this->load->model('shopmodel');
        $result['query'] = $this->shopmodel->selectkonzol($data);
        
    
        $data[$platform] = 'T';
        $this->load->view('index',$data);
        
        
        if(!empty($result))
        {
        $this->load->view('products/games',$result);    
        }
        else
        {
        $this->load->view('products/noproduct',$database);
        }

        $this->load->view('index2');
    }
}

Model
Code:
class Shopmodel extends Model {

    function index()
    {
        // Call the Model constructor
        parent::Model();
            
    }

    function selectkonzol($data)
    {
        
    $platform   = $data['platform'];
    $what   = $data['what'];
    
    if($what=="games")
    {
    $query = "SELECT * FROM `games` WHERE `platform`='$platform'";
    }
    else
    {
        $query = "SELECT * FROM `products` WHERE `platform`='$platform' and 'productcat'='$what'";
    }
    
    
    $result=$this->db->query($query);
    return $result->result();
    }
}

If I have no results, it doesnt load the other viewSad

Why is this happening?


  Extending classes
Posted by: El Forum - 11-01-2008, 06:47 AM - Replies (3)

[eluser]Nutan Lade[/eluser]
I had a controller and for validation purposes I am using Oauth.php validations for public key.
Now I need to place these files on my server.I don't know where should these files should be placed.The following are the files I am using for this purpose.
CertFileAccessor.php for accesing the certificate certficate123.cer
OAuth.php for processing the requests made.
MakeSignedRequest.php in this class I am using some functions to call.
And my controller is Movies.php.
Please help me where should I keep these files and how to access these files in my controller.
Thanq in advance.


  Possible to only store some data in the Sessions table? (about 1.7.0 change)
Posted by: El Forum - 11-01-2008, 05:43 AM - Replies (2)

[eluser]inktri[/eluser]
I maintain some data that is non critical in the session cookie and I have to access to access it a lot. Therefore I want to keep some stuff solely in the session cookie so my script doesn't make so many DB calls. Is that possible? or should I just create another cookie for the non critical data?


  CMS - Pre-release WIP.1 of V1.0 available for download.
Posted by: El Forum - 11-01-2008, 04:57 AM - Replies (10)

[eluser]dbashyal[/eluser]
UPDATED
Download/preview here.

Its good to see that download counter hit 200s mark.

Now Codefight is powered by this cms.

Added tag cloud, and enhanced admin for more options. The CMS is bending towards blogs path Smile .

Next pre-release code will take sometime to come out as i'm bit busy.

I would like to get some feature contribution if anyone is interested, as i am unable to take it with full speed because of less time i get after work and my new born baby. I am only able to work on this few hours on weekends.


Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Latest Threads
SQL server connection not...
by kenjis
24 minutes ago
CVE-2022-40834 SQL Inject...
by kenjis
1 hour ago
Retaining search variable...
by pchriley
1 hour ago
How to use Codeigniter wi...
by sr13579
2 hours ago
Disable debug output in v...
by groovebird
2 hours ago
CI 4.5.1 CSRF - The actio...
by kenjis
4 hours ago
CodeIgniter v4.5.0 Releas...
by kenjis
4 hours ago
Cache best practice?
by BhambriRohunu
5 hours ago
Bug with sessions CI 4.5....
by InsiteFX
6 hours ago
Codeigniter Shield Bannin...
by kenjis
10 hours ago

Forum Statistics
» Members: 85,328
» Latest member: study_nz
» Forum threads: 77,578
» Forum posts: 375,994

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB