thedigicraft / Atom.CMS

Atom.CMS
56 stars 50 forks source link

Part 80: my single quotes are slanting? #135

Open Chriswilldo opened 9 years ago

Chriswilldo commented 9 years ago

When i type it out, the coding looks perfect, however in my actual coding the single quote by url( slants. This has never happened before and it bothers me. I assumed it was because i set my language to us int, but that didn't change anything. Not sure what to do here.. I'll see if it still works in my coding, but I'm assuming it doesn't... my error

Chriswilldo commented 9 years ago

Sigh still works. Sorry. Still kind of bothers me though..

Chriswilldo commented 9 years ago

I lied. The coding still works, but it doesn't switch the picture until i refresh. When I left avatar.php untouched it would switch the image right away, but in its' original size. Then after refreshing, it would shrink? If I change it to match the avatar-container coding, it'll hide show no image, then appear when i refresh. Again not a huge deal, but I am kind of curious as to why my aptana likes to italic my single quote when under a style tag? Even when I switch it class, form, etc, it doesn't italic it. Only under style... Any ideas?

creptor commented 9 years ago

You have inputed an invalid css inside the html tags... the code looks just like this:

<div /*etc*/ style="background-image: url( ´../uploads/{php}')"

So starting in that code you have misplaced a ' with a ´ at the start, that the browsers would have trouble reading probably, and the second thing is that you need to make sure the <?php echo $opened['avatar'];?> comes in the format of the image, like image.jpg.

fixed:

<div /*etc*/ style="background-image: url('../uploads/{php}')"
Chriswilldo commented 9 years ago

I didn't place the italic ' on purpose. It does it for me automatically. e 3 error 2

See what I mean?

Chriswilldo commented 9 years ago

It's not a huge issue to me. If anything all i have to do is refresh and it'll work. I just wanted it to work right away like shown.

creptor commented 9 years ago

what browser are you using?

Chriswilldo commented 9 years ago

I'm using firefox now as recommended in the series, but sometimes I like to switch to chrome just to see if it's working properly on both. If your asking about what Aptana n Xampp their both the latest version you can get. aptana 3.6.1, xampp 3.2.1.

creptor commented 9 years ago

maybe more info on what refreshing the page for you means?

Chriswilldo commented 9 years ago

If I refresh, it'll change the picture. So it still technically works, but I need to refresh it. Because in the video it shows how you should be able to drag the picture into the drop box and it would switch the picture instantly without refresh. However on mine.. 1 2 3 Because of the italic ' , it won't work to its' full potential. Still, I can't really complain because I've dealt with worse errors. At least it works. I was just hoping to figure out why that was.

creptor commented 9 years ago

Now that makes sense.... the ajax you have is worng, could you please post that code? I can find the error for you. :smile:

Chriswilldo commented 9 years ago

ajax/list-sort.php:

<?php

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

$list = $_GET['list'];

foreach ($list as $position => $id) {

$q = "UPDATE navigation SET position = $position WHERE id = $id"; $r = mysqli_query($dbc, $q); echo mysqli_error($dbc);

}

?>

ajax/avatar.php: (My avatar container div class in this is also affected with the italic ' syndrome.)

<?php

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

$id = $_GET['id'];

$q = "SELECT avatar FROM users WHERE id = $id"; $r = mysqli_query($dbc, $q);

$data = mysqli_fetch_assoc($r);

?>

ajax/navigation.php:

<?php

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

$label = mysqli_real_escape_string($dbc, $_POST['label']);
$url = mysqli_real_escape_string($dbc, $_POST['url']);

$q = "UPDATE navigation SET id = '$_POST[id]', label = '$label', url = '$url', status = $_POST[status] WHERE id = '$_POST[opened]'";
$r = mysqli_query($dbc, $q);

if($r) { echo 'Saved
'.$q; } else {

echo mysqli_error($dbc).'
'.$q;

}

?>

ajax/pages.php:

<?php

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

$id = $_GET['id'];

$q = "DELETE FROM pages WHERE id = $id"; $r = mysqli_query($dbc, $q);

if($r) { echo 'Page Deleted'; } else {

echo 'There was an error...(break tag)'; echo $q.'(break tag)'; echo mysqli_error($dbc);

}

?>

I had to write in break tags here otherwise it would space it out here. Hope that makes sense.. Let me know if you need to see any more of my coding.

creptor commented 9 years ago

Flor the avatar.php you should have after that code the image html. The script it's supposed to load the data given by this file, so if you don't put the image html (with the php to get the image) it will just empty the image you have. That is also why you have to refresh the page to see the new image