thedigicraft / Atom.CMS

Atom.CMS
56 stars 52 forks source link

Users Have Disappeared Again. #15

Closed hashmi82 closed 10 years ago

hashmi82 commented 10 years ago

My Users have disappeared the spaces are there but nothing in them other than a comma. I click on the user space and it populates the form. This is after creating the user page.

hashmi82 commented 10 years ago

Cheers, Paul

thedigicraft commented 10 years ago

Hey Paul,

Can you copy/paste your data.php and your `setup.php`` for me?

hashmi82 commented 10 years ago

Yeah sorry was just opening everything up and got side tracked here you go.

data.php <?php

function data_setting_value($dbc, $id){

$q = "SELECT * FROM settings WHERE id = '$id'";
$r = mysqli_query($dbc, $q);

$data = mysqli_fetch_assoc($r);

return $data['value'];

}

function data_user($dbc, $id) { if(is_numeric($id)){ $cond= "WHERE id = '$id'";
} else { $cond= "WHERE Email = '$id'"; }

$q = "SELECT * FROM Users $cond";
$r = mysqli_query($dbc, $q);

$data = mysqli_fetch_assoc($r);
$data['fullname'] = $data['First'].' '.$data['Last'];
$data['fullname_reverse'] = $data['Last'].', '.$data['First'];

return $data;

}

function data_page($dbc, $id) {

$q = "SELECT * FROM Pages WHERE id = $id";
$r = mysqli_query($dbc, $q);

$data = mysqli_fetch_assoc($r);

$data['body_nohtml'] = strip_tags($data['body']);   

if($data['body'] == $data['body_nohtml']) {

    $data['body_formatted'] = '<p>'.$data['body'].'</p>';

} else {

    $data['body_formatted'] = $data['body'];    
}

return $data;

} ?>

setup.php

<?php //Setup File

error_reporting(0);

Database Connection

include ('../Config/connection.php');

//Constants DEFINE('D_TEMPLATE' , 'Template');

//Functions include('Functions/data.php'); include('Functions/template.php'); include('Functions/sandbox.php');

Site Setup

$debug = data_setting_value($dbc, 'debug-status');

$site_title = 'Site Under Construction';

if(isset($_GET['page'])) { $page = $_GET['page']; // Set $pageid to equal the value given in url } else { $page = 'dashboard'; // Set $pageid equal to 1 or Home Page }

//Page Setup include('Config/queries.php');

User Setup

$user = data_user($dbc, $_SESSION['username']);

?>

hashmi82 commented 10 years ago

Hi,

I cheated and pulled the source from repository now all working.

Cheers, Paul

thedigicraft commented 10 years ago

Haha, its not cheating ;-)

You might try using a compare tool sometimes when things like this come up. That way you can see what you did incorrectly.

hashmi82 commented 10 years ago

compare tool?