|
|
 |
BOOK: Professional CodeIgniter ISBN: 978-0-470-28245-8
 | This is the forum to discuss the Wrox book Professional CodeIgniter by Thomas Myer; ISBN: 9780470282458 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Professional CodeIgniter ISBN: 978-0-470-28245-8 section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

June 3rd, 2009, 12:01 AM
|
|
Registered User
|
|
Join Date: May 2009
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Error in sample code "Professional Codeigniter"
Hai everyone!
I have lots of question about u'r book Thomas. Despite lot's of error inside of it, i have to say this is a really nice book.
I have a couple of question if you don't mind Thomas.
1. I can't click any link from the shopping sample code, until I change the config.php, and the value $config['index_page'] = ""; and use the index.php inside it. Why this happen?
2. Cannot login into the dasbord. I manage to login, after I change the autoload helper autoload.php and remove security in it. $autoload['helper'] = array('url','form','text','date',''); and remove this entry from models madmins.php
Quote:
//$this->db->where('username',db_clean($u,16));
//$this->db->where('password', db_clean(dohash($pw),16));
|
Can you explain to me?
3. In the admin pages home, on the Full Path collumn i keep getting error "
A PHP Error was encountered
Quote:
Severity: Notice
Message: Undefined index: category_id
Filename: views/admin_pages_home.php
Line Number: 22
|
i really stuck in this, can you give a hand? I have attach the view (admin_pages_home.php), controller (pages.php) and models (mcats.php).
Sory for my bad english. English not my primary language :)
Thanks before i really need u'r help.
--
Trims,
Bob
|

June 3rd, 2009, 08:45 AM
|
|
Wrox Author
|
|
Join Date: May 2008
Location: Austin, TX, USA.
Posts: 52
Thanks: 0
Thanked 4 Times in 4 Posts
|
|
I'm going to work this offline for a bit
Hi guys, I'm working with langithitam via email as I suspect I'll need to dig through his config and setup. When I get it all straightened out, I'll post here.
__________________
Thomas Myer
Author, Professional CodeIgniter
http://www.tripledogs.com
|

June 3rd, 2009, 09:05 AM
|
|
Wrox Author
|
|
Join Date: May 2008
Location: Austin, TX, USA.
Posts: 52
Thanks: 0
Thanked 4 Times in 4 Posts
|
|
Part of the mystery solved
For #3, please use code on page 243. I think I sent the publisher the wrong file for admin_pages_home.php, so the ZIP is incorrect. Not sure how that happened. Will remediate as soon as I can.
__________________
Thomas Myer
Author, Professional CodeIgniter
http://www.tripledogs.com
|

June 3rd, 2009, 09:18 AM
|
|
Registered User
|
|
Join Date: May 2009
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
mysteri no#3 solved, the error is in the source code. I should use the script from the book.. thanks to myer
PHP Code:
<h1><?php echo $title;?> </h1> <p><?php echo anchor("admin/pages/create", "Create new page");?> </p> <?php if ($this-> session-> flashdata('message')){ echo "<div class='message'> ".$this-> session-> flashdata('message')."</div> "; } if (count($pages)){ echo "<table border='1' cellspacing='0' cellpadding='3' width='400'> \n"; echo "<tr valign='top'> \n"; echo "<th> ID</th> \n<th> Name</th> <th> Status</th> <th> Actions</th> \n"; echo "</tr> \n"; foreach ($pages as $key => $list){ echo "<tr valign='top'> \n"; echo " <td> ".$list['id']."</td> \n"; echo "<td> ".$list['name']."</td> \n"; echo "<td align='center'> ".$list['status']."</td> \n"; echo "<td align='center'> "; echo anchor('admin/pages/edit/'.$list['id'],'edit'); echo " | "; echo anchor('admin/pages/delete/'.$list['id'],'delete'); echo "</td> \n"; echo "</tr> \n"; } echo "</table> "; } ?>
Last edited by langithitam : June 3rd, 2009 at 10:30 PM.
|

June 3rd, 2009, 09:07 PM
|
|
Wrox Author
|
|
Join Date: May 2008
Location: Austin, TX, USA.
Posts: 52
Thanks: 0
Thanked 4 Times in 4 Posts
|
|
Corrected code for admin_pages_home.php view
PHP Code:
<h1><?php echo $title;?></h1>
<p><?php echo anchor("admin/pages/create", "Create new page");?></p>
<?php
if ($this->session->flashdata('message')){
echo "<div class='message'>".$this->session->flashdata('message')."</div>";
}
if (count($pages)){
echo "<table border='1' cellspacing='0' cellpadding='3' width='400'>\n";
echo "<tr valign='top'>\n";
echo "<th>ID</th>\n<th>Name</th><th>Status</th><th>Actions</th>\n";
echo "</tr>\n";
foreach ($pages as $key => $list){
echo "<tr valign='top'>\n";
echo "<td>".$list['id']."</td>\n";
echo "<td>".$list['name']."</td>\n";
echo "<td align='center'>".$list['status']."</td>\n";
echo "<td align='center'>";
echo anchor('admin/pages/edit/'.$list['id'],'edit');
echo " | ";
echo anchor('admin/pages/delete/'.$list['id'],'delete');
echo "</td>\n";
echo "</tr>\n";
}
echo "</table>";
}
?>
__________________
Thomas Myer
Author, Professional CodeIgniter
http://www.tripledogs.com
|

November 1st, 2009, 06:20 AM
|
|
Registered User
|
|
Join Date: Nov 2009
Posts: 25
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
Answer for #2 and 3
For login, the original code hash the pw using SHA1 and use the first 16 letters.
So I suggest you put back the code as original.
Then go to http://www.whatsmyip.org/hash_generator/, and copy and paste the first 16letters of SHA1 into password for admin in admins table in your database.
Then try it again.
Regarding #3.
The following is the code for admin_page_home.php I use to show the path.
Code:
<h1><?php echo $title;?></h1>
<p><?php echo anchor("admin/pages/create", "Create new page");?></p>
<?php
if ($this->session->flashdata('message')){
echo "<div class='message'>".$this->session->flashdata('message')."</div>";
}
if (count($pages)){
echo "<table border='1' cellspacing='0' cellpadding='3' width='600'>\n";
echo "<tr valign='top'>\n";
echo "<th>ID</th>\n<th>Name</th><th>Full Path</th><th>Status</th><th>Actions</th>\n";
echo "</tr>\n";
foreach ($pages as $key => $list){
echo "<tr valign='top'>\n";
echo "<td>".$list['id']."</td>\n";
echo "<td>".$list['name']."</td>\n";
echo "<td>";
if (!preg_match("/\.html$/",$list['path'])){
$list['path'] .= ".html";
}
if ($list['category_id'] == 0){
echo "/". $list['path'];
}else{
echo "/". $cats[$list['category_id']]. "/". $list['path'];
}
echo "</td>";
echo "<td align='center'>".$list['status']."</td>\n";
echo "<td align='center'>";
echo anchor('admin/pages/edit/'.$list['id'],'edit');
echo " | ";
echo anchor('admin/pages/delete/'.$list['id'],'delete');
echo "</td>\n";
echo "</tr>\n";
}
echo "</table>";
}
?>
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |