Jump to content
Killersites Forums


  • Posts

  • Joined

  • Last visited

CLU's Achievements


Newbie (1/14)



  1. It seems that you are right, I wasnt thinking about them being essentially on the same domain. Cheers for helping out... Also a heads up on another potential issue with the colorbox and the long. Because everything within the innit file is absolute so the site path being stated as www.domain.com... if a user types domain.com ... then when they click on the login link it throws an error, as its not including the www. The simple solution i fount was to create a htaccess file and just make sure the url is changed to match that within the innit file. Just a heads up. Thanks again.
  2. At the moment the two sites that I have tested are on local servers, I was running tests to check everything and this is when i came across this issue. They are both reading from different databases, could the issue be with regards to the salt being the same?
  3. It still seems to allow the user access irrespective of whether there PW and usernames are the same... So it just allows access... I really cannot find out how to prevent this....
  4. Hi Guys, I think I have came across a potential security issue with the build a CMS. It seems there is a worrying issue, that being if you had two different sites, then the users that login for one would be able to log into the other. I think this must have something to do with the session start. Although there would have to be some form of serendipity as the users will have to be using the same browser, but still this seems to be rather worrying. Would/does anyone have a solution to this? Maybe this could be solved by changing the salt? If anyone could help that would be great. CLU
  5. Hi Guys ok, Im starting to get the hang of PHP OOP and MVC, what i cannot seem to prevent are Notices: Undefined Variables. I understand i can switch this off, but i just want to know why proper way to get this done. Does anyone know. Here is my code: From my model m_settings: function siteSettings() { if ($stmt = $FS->Database->query("SELECT * FROM site_settings WHERE id='1'")) $row = mysqli_fetch_array($stmt); } This is just grabbing the results from a database and relaying them onto the view... which is the following: v_index.php: <tr><td>Browser Title: <input type="text" name="browser_title" value="<?php echo $row['browser_title'];?>" placeholder="Enter your sites browser title here."> </td></tr> <tr><td>Site Meta-Tags: <input type="text" name="met_tag" value="<?php echo $row['meta_tag'];?>" placeholder="Site Meta-Tags go here."> </td></tr> <tr><td>Description: <input type="text" name="description" value="<?php echo $row['description'];?>" placeholder="Site Description."> </td></tr> All the code above is placed within a table. This is the controller <?php include('../init.php'); include("models/m_settings.php"); $Settings = new Settings(); $FS->Template->load(APP_PATH . 'settings/views/v_index.php'); I can't understand why I'm getting the following Notices : <br /><b>Notice</b>: Undefined variable: row in <b>/Applications/MAMP/htdocs/ukmocks/app/settings/views/v_index.php</b> on line <b>26</b><br /> The above happens for every $row echoed out... I know i can add some code to the top of the page that will get rid of the notices, but i love to learn and want to know why this si happening If anyone can help give me a shout Thanks again
  6. CLU

    This is Driving me nuts

    So do you think i could have it in just one function... Maybe this could be easier... Basically for the two mysqli quieries is checking to see if the typwe within the database is test, and if it is then it will echo the title and body, I have updated this to use the Exerpt so that it only shows 10 characters form the post. But I think (correct me if im wrong) but could i just fetch the array in the top query and then just display the results in the following $row['title'] and the same for post. I think by watching your tutorials on here has really helped me learning OOP... As it seems other tuts online made it confusing... Let me know what you think. Also im not sure if you have found this bug within safari (seemingly is a css bug) but it seems that sometime if you float content within the WYSIWYG editor the content overlaps the content below... I have added <div>'s that clear but as soon as you log out it is fine... This issue is not present in Mozzilla, but in the Webkit browsers its present... Just thought I'd give you a heads up if you have experienced this before?
  7. CLU

    This is Driving me nuts

    Hi Ben, Thanks again for your help... It would seem whilst we have came to the same'ish conclusion.... I did this lastnight function display_blog() { $blog_posts = $this->load_blog(); if ($this->FS->Auth->checkLoginStatus()) { $blog_start = '<div class="fs_edit">'; $blog_link = '<a class="fs_edit_quotes" href="' . SITE_PATH . 'app/blog/index.php">Edit Blog</a>'; $blog_end = '</div>'; echo $blog_start . $blog_link . $blog_end; } else { echo $blog_posts; } } function load_blog() { $stmt = $this->FS->Database->query("SELECT id, type, LEFT(title, 10)AS title_excerpt, title, author FROM blog_posts ORDER BY id Limit 3"); $row = mysqli_fetch_array($stmt); if ($row['type'] == 'text') { $stmt = $this->FS->Database->prepare('SELECT id, title, body, type FROM blog_posts ORDER BY id Limit 1'); $stmt->execute(); $stmt->bind_result($id, $title, $body, $type); while ( $row = $stmt->fetch() ) : echo'<div id="last_posts">'; echo $title; echo $body; echo'</div>'; endwhile; } } I am using some if statements to make sure the posts are text, as the last thing i want on the home page is image' and/or videos... Seems to be working fine. I also tried the above code and that worked fine aswell... LEt me know if there is anything i shouldnt be doing or maybe could i refactor this code to be more effective? So out of curiosity when should i prepared statements... Is that when im only going to bind the results? It just seems that someone wont be able to bind '*' as its everything... Let me know your thoughts and once again thanks for your help...
  8. CLU

    This is Driving me nuts

    Hi Ben, There errors that i am getting are the following: Notice: Undefined variable: result in /Applications/MAMP/htdocs/ukmocks/app/cms/models/m_cms.php on line 211 Fatal error: Call to a member function fetch_object() on a non-object in /Applications/MAMP/htdocs/ukmocks/app/cms/models/m_cms.php on line 211 That line seems to be 'while ($row = $result->fetch_object())'... Any ideas whats going on? Thanks again...
  9. CLU

    This is Driving me nuts

    HI Ben, thanks for your reply. I tired that code out but as soon as that code is added and the call of <?php $FS->Cms->display_blog(); ?> is added to my index page the page breaks and i get a HTTP ERROR 500 (Internal Error Page) display. This is really confusing as to why it is not working... Because from the code above it seems logical to me and it should work... Any other suggestions?
  10. CLU

    This is Driving me nuts

    Thant for your reply Symphlion, excuse my ignorance but i still can't work it out... I have changed the code to which i think you was talking about... function load_blog() { // get contents from database if ($stmt = $this->FS->Database->prepare("SELECT * FROM blog_posts ORDER BY id")) { $stmt->execute(); $stmt->store_result(); if ($stmt->num_rows > 0) { $stmt->bind_result($blog_posts); $stmt->fetch(); $stmt->close(); return $status; } else { $stmt->close(); return FALSE; } } } function display_blog() { // get content $status = $this->load_blog(); echo $status; // check login status if ($this->FS->Auth->checkLoginStatus()) { echo $status; } else { } } I changed the return to $status which is a column within the database and have echoed that out.. Im still having trouble... I appreciate your time and help... How would you write it out... Im sure this is probably something simple that i am over looking :-/
  11. CLU

    This is Driving me nuts

    Really appreciate your replies guys... @Ben the page loads as normal... But does not display anything to do with the stated function. But when i am logged in it does echo out the ''You are logged in"... Really don't know what i am doing wrong? @symphlion I thought by having 'return $blog_posts;' That i would be returning the result? The second thing was just testing to see if just echoing anything out would work. Still trying to work it out... Can you guys see something I'm missing? Thanks again
  12. Hi everyone, I wonder if anyone can see what i am doing wrong here... I have created a table called blog_posts and just want to echo the posts onto my index page. I have created the cms application from Bens tutorials, and essentially i am trying to copy what he did with his code to create two new functions (display_blog and load_blog) All i want to do is use this function on my index page... But cannot see where i am going wrong.... Heres my code: (m_cms.php) function load_blog() { // get contents from database if ($stmt = $this->FS->Database->prepare("SELECT * FROM blog_posts ORDER BY id")) { $stmt->execute(); $stmt->store_result(); if ($stmt->num_rows > 0) { $stmt->bind_result($blog_posts); $stmt->fetch(); $stmt->close(); return $blog_posts; } else { $stmt->close(); return FALSE; } } } function display_blog() { // get content $blog_posts = $this->load_blog(); // check login status if ($this->FS->Auth->checkLoginStatus()) { echo'You are logged in'; } else { echo $blog_posts; } } Code on my index page : <?php $FS->Cms->display_blog();?> If anyone can give me some guidance I would appreciate it alot Kind Regards CLU
  13. This looks good, nice work ben. Do you think i could take the view code and put it into a class. Then call the class to display a database?
  14. Hi Guys, I was wondering that for somereason when ever I add anything jquery or javascript to the flightpath cms certain things stop working... I think this has something to do with the noconflict... But how do i use this with jquery on the frontend of the site? If anyone has any help this would be most appreciated... Kind Regards
  15. @neliuz Yea got it sorted, the issue was within the config file. As i was/am using MAMP on my mac within my HTdocs folder i had another folder (With the cms and site within) From this i never added the folder name to the path within the plugins config file... So it stated the path was wrong. All you have to do is create a fold (I called mine upload) and place it on the front end of your site... Type in its relative path... so mine was /images/uploaded_images (No trailing slash) and hey presto it worked. Hope this helps bud.
  • Create New...