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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 12,668
» Latest member: Eliad
» Forum threads: 68,825
» Forum posts: 428,635

Full Statistics

Latest Threads
Error codeigniter generat...
Forum: Installation & Setup
8 minutes ago
» Replies: 12   » Views: 253
Migrate CI2 to CI3
Forum: Jobs
18 minutes ago
» Replies: 4   » Views: 124
Reporting Tools On CodeIg...
Forum: General Help
2 hours ago
» Replies: 4   » Views: 2,749
Admin password/email cha...
Forum: Best Practices
5 hours ago
» Replies: 1   » Views: 50
Array Randomizer?
Forum: General Help
5 hours ago
» Replies: 3   » Views: 90
CodeIgniter 4.0.0-alpha.3...
Forum: News & Discussion
9 hours ago
» Replies: 19   » Views: 6,422
Alternate to use keyword
Forum: Addins
9 hours ago
» Replies: 0   » Views: 41
Using GraphQL with CL3
Forum: Libraries & Helpers
Yesterday, 09:02 PM
» Replies: 1   » Views: 111
Codeigniter Get List all ...
Forum: General Help
Yesterday, 08:58 PM
» Replies: 0   » Views: 43
[split] Broken database s...
Forum: CodeIgniter 3.x
Yesterday, 05:01 PM
» Replies: 9   » Views: 4,120

 
  Admin password/email changed and he still logged in and carried operations
Posted by: codingdreams - 8 hours ago - Forum: Best Practices - Replies (1)

Hello,
A  system developed with  Codeigniter is It is giving us admin log issues.

When Admin  password is changed  in DB, the  Admins is still logged in and carry operations
When  the admin  email is changed in DB , the same admin is still logged on and carry operations.
When both email and password is changed  in DB , the still logged on and carried operation.

Please, how can we resolve this?
How can the admin be logged of immediately hiw password or Email is Changed? 

Any suggestion will be help.


Thank you in advance.


  Alternate to use keyword
Posted by: baxterheinen - 9 hours ago - Forum: Addins - No Replies

I would like to use this library/tool with CI3:

https://github.com/webonyx/graphql-php

It is normal OOP PHP so it uses namespaces and the 'use' keyword. How do I go about converting that to Codeigniter that doesn't? Do I just go thru all the files and change then to require('')?


Photo Codeigniter Get List all Classes and Methods
Posted by: NotaPwntester - Yesterday, 08:58 PM - Forum: General Help - No Replies

Hello CI patrons. 

I am just creating a simple library to get list all classes and methods on HMVC structure, i called the function on MY_Controller but here something wrong to get methods
and when i var_dump it got result like this 
[Image: image.png]

,there's something wrong with my code ? 

Thank you


PHP Code:
[color=#333333]public static function get_class_and_methods()
[/color]
    {

        // $classes = get_declared_classes();



        $appdir     APPPATH."modules";

        $appdirScan array_diff(scandir($appdir), array('.''..'));

        echo "<pre>";

        $arrAllModules = [];

    

        
foreach ($appdirScan as $keyParent => $module) {

            $scanperModule array_diff(preg_grep('~\.(php|phtml)$~'scandir($appdir."/".$module."/controllers")), array('.''..'));

            $arrAllModules[] = $scanperModule;



            foreach ($scanperModule as $keyFChild => $value) {

                // $a = file_get_contents($appdir."/".$module."/controllers/".$value);

                $classes self::getClassNameFromFile($appdir."/".$module."/controllers/".$value);

                $methods get_class_methods($classes);

                var_dump ($methods);

                // $aUserMethods = array();

                // if(is_array($methods)){

                    // foreach($methods as $method) {

                        // var_dump ($method);

                        // if($method != '__construct' && $method != 'get_instance' && $method != $classes && $method != "setOutput" && $method != "checkAjaxSession" && $method != "setDeniedPage" && $method != "debug" && $method != "__get") {

                        //     $aUserMethods[] = $method;

                        // }

                    // }

                // }

            }

        }

        // $flatten = array_flatten(array_merge($arrAllModules));



        die();



    }



    private static function getClassNameFromFile($filePathName)

    {

        $php_code file_get_contents($filePathName);



        $classes = array();

        $tokens token_get_all($php_code);

        $count count($tokens);

        for ($i 2$i $count$i++) {

            if ($tokens[$i 2][0] == T_CLASS

                
&& $tokens[$i 1][0] == T_WHITESPACE

                
&& $tokens[$i][0] == T_STRING

            
) {



                $class_name $tokens[$i][1];

                $classes[] = $class_name;

            }

        }



        return $classes[0];

    }





    function array_flatten($array) { 

        
if (!is_array($array)) { 

            
return FALSE; 

        
} 

          

        $result 
= array(); 

        
foreach ($array as $key => $value) { 

            
if (is_array($value)) { 

              $result 
array_merge($resultarray_flatten($value)); 

            
} 

            
else { 

              $result
[$key] = $value; 

            
} 

        
} 

          
return $result;
[
color=#333333]    } 
[/color


  unexpected T_CONST--Help Please
Posted by: bhogsett - Yesterday, 11:31 AM - Forum: General Help - No Replies

One of the four web sites I have created with CI has suddenly started getting this error:

Parse error: syntax error, unexpected T_CONST in /home3/billhogs/public_html/ccbridgeclub/system/core/CodeIgniter.php on line 58

I read a thread here in May that suggested reloading the system directory.  The website was running 3.1.3 so I upgraded to 3.1.9 (renamed the 3.1.3 application and system dirs and uploaded 3.1.9 dirs along with the index.php).

I get the same error in the new 3.1.9.  Confused

The php is 7.0.x

Any help will be greatly appreciated and I will report what finally solved the issue.

Thanks in advance.


Bill


  favicon.ico 404 for the forum
Posted by: PopovMP - Yesterday, 06:02 AM - Forum: Issues - Replies (1)

Hello guys,

Please check why the wonderful flames do not light the CI forum's tab.

Code:
https://forum.codeigniter.com/favicon.ico gives 404

[Image: ci-forum-favicon-404-thumb.png]


Wink Array Randomizer?
Posted by: kaitenz - Yesterday, 03:17 AM - Forum: General Help - Replies (3)

Hi everyone.

I want to distribute/assign some data randomly but even amount from an array of users to an array of data.

Here's an example:

I have an array of user ids:

PHP Code:
$users = array(204725210194); 

Then the array of data:
PHP Code:
$data = array(
 
   array('department' => '???''datecreated' => '???'),
 
   array('department' => '???''datecreated' => '???'),
 
   array('department' => '???''datecreated' => '???'),
 
   array('department' => '???''datecreated' => '???'),
 
   array('department' => '???''datecreated' => '???'),
 
   array('department' => '???''datecreated' => '???'),
 
   array('department' => '???''datecreated' => '???'),
 
   array('department' => '???''datecreated' => '???'),
    array('department' => '???''datecreated' => '???'),
    array('department' => '???''datecreated' => '???'),
    array('department' => '???''datecreated' => '???'),
    array('department' => '???''datecreated' => '???'),
    array('department' => '???''datecreated' => '???'),
    array('department' => '???''datecreated' => '???'),
    array('department' => '???''datecreated' => '???'),
    array('department' => '???''datecreated' => '???'),
    array('department' => '???''datecreated' => '???')
);

// Just assume that we have real data :) 

And the result should be like this (to be used by Query Builder's insert_batch()):
PHP Code:
$data = array(
 
   array('department' => '???''datecreated' => '???''assignee' => '20'),
 
   array('department' => '???''datecreated' => '???''assignee' => '210'),
 
   array('department' => '???''datecreated' => '???''assignee' => '25'),
 
   array('department' => '???''datecreated' => '???''assignee' => '194'),
 
   array('department' => '???''datecreated' => '???''assignee' => '47'),
 
   array('department' => '???''datecreated' => '???''assignee' => '20'),
 
   array('department' => '???''datecreated' => '???''assignee' => '25'),
 
   array('department' => '???''datecreated' => '???''assignee' => '194'),
    array('department' => '???''datecreated' => '???''assignee' => '20'),
    array('department' => '???''datecreated' => '???''assignee' => '194'),
    array('department' => '???''datecreated' => '???''assignee' => '210'),
    array('department' => '???''datecreated' => '???''assignee' => '47'),
    array('department' => '???''datecreated' => '???''assignee' => '210'),
    array('department' => '???''datecreated' => '???''assignee' => '25'),
    array('department' => '???''datecreated' => '???''assignee' => '20'),
    array('department' => '???''datecreated' => '???''assignee' => '210'),
    array('department' => '???''datecreated' => '???''assignee' => '47')
); 

Now, I want to assign (from the example) 17 rows to 5 users. So 3 for each user (and the remaining 2 will be either distributed to a random user or to the last person). We want this to be random. I tried to code it myself but failed.

How can I achieve this? Any help?
Thank you very much Smile


  Codeigniter + Infinity scroll help
Posted by: HarrysR - 12-11-2018, 04:15 PM - Forum: General Help - Replies (2)

Hey guys,
I was wondering, has anyone made a project with infinite scroll and filtering data with "GET" parameters in url? Do you know any good examples to begin with? 
Since every tut i found on internet was about infinite scroll and not with data filtering using query string parameters. 

Should i make two different controllers (sth like "index" and "entries") or can i achieve it with a single controller?

Note that i don't want to refresh the page on every dropdown change, i just want to refresh the "div" content.

I hope i made myself clear! If you need any further clarification feel free to ask!

Thanks!


  xaiborweb
Posted by: InsiteFX - 12-11-2018, 10:19 AM - Forum: Lounge - No Replies

@xaiborweb

No one can reply to you because you private messaging turned off.


  Migrate CI2 to CI3
Posted by: SonnyBarrett - 12-11-2018, 10:15 AM - Forum: Jobs - Replies (4)

We are looking for a developer to help us to migrate from CI2 to CI3 through these 21 Steps .. . https://www.codeigniter.com/user_guide/installation/upgrade_300.html

We seek someone that has the ability to complete this migration process and can make it as streamlined as possible for the transition.

We have an "admin" and "client" area which has around 45 models and around 50 controllers total between both areas.


Please contact me if you are inside the USA and have CI2-CI3 migration experience.


  Smart cache library
Posted by: msnisha - 12-10-2018, 04:13 PM - Forum: Addins - Replies (1)

We have created a free smart cache library for CodeIgniter and made it available in Github at https://github.com/msnisha/smart-cache If anyone interested please download and use it. 

Features

1. Partial caching of views
2. Keeping dynamic session variable within cached files using hook. (Example Username in cached header)
3. Conditionally accessing cache content.



  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2018 MyBB Group.