News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

Admin page - funky code output

Started by zarth, June 16, 2007, 11:04:27 PM

Previous topic - Next topic

zarth


> Username Image Name Image Size Date Delete
"; $images = mysql_query("SELECT * FROM `member_images` ORDER by `username` ASC"); while($image = mysql_fetch_array($images)) { $imagesize = $image['image_size']/1024; $imagesize = (strlen($imagesize) > 4)? htmlspecialchars(substr($imagesize, 0, 4) . ''):htmlspecialchars($imagesize); print " $image[username] $image[image_name] $imagesize KB $image[date]  "; } print " 
"; mysql_select_db("user_smf"); } function template_delimage() { global $image, $id, $context, $user_info, $db_prefix, $images; mysql_select_db("user_mainDB"); for($x = 0; $x < count($images); $x++) { $select_image = mysql_query("SELECT * FROM `member_images` WHERE id = '$images[$x]'"); $image = mysql_fetch_array($select_image); $delete = unlink("/home/user/public_html/members/files/$image[image_name]"); $deletedb = mysql_query("DELETE FROM `member_images` WHERE id='$images[$x]'"); if(!$delete) script_error("Image doesn't exist"); } redirectexit("action=imagelog"); mysql_select_db("user_smf"); } function template_delimage2() { global $imagename, $id, $context, $user_info, $db_prefix;; mysql_select_db("user_mainDB"); if(empty($imagename)) { print "Please insert an image name.

"; exit; } $check = mysql_query("SELECT * FROM `member_images` WHERE username='$username' AND image_name = '$imagename'"); $image = mysql_fetch_array($check); if(!$check) print "You can not delete this image, because it's not yours.

"; else { mysql_query("DELETE FROM `member_images` WHERE image_name='$imagename'"); $delete = unlink("/home/user/public_html/members/files/$imagename"); if($delete) redirectexit('action=modifypoll'); else print "Image doesn't exist.

"; } mysql_select_db("user_smf"); } ?>


This piece of code appears above everything else in the page, only in the Administration Center (and all sub-pages of this).

Just to clarify, this is what follows:


Page title

Hey, admin, you have 297 messages, 0 are new.
Show unread posts since last visit.
Show new replies to your posts.
June 17, 2007, 05:13:33 AM


What is it? I can see that it has something to do with images and such, but why on earth is it displayed all the way up there? How can I get rid of it?

This happened after restoring a backup of my home directory and the database SMF uses, see this thread for another issue directly related to this restoration of the same backups.

Here are the specs.

SMF 1.1 RC1
Apache version  1.3.37 (Unix)
PHP version     4.4.2
MySQL version     4.1.21-standard

!Hachi!

why don't upgrade to stable versio...
Happy Ramadan

zarth

...I was trying to. The upgrade.php choked and left my database in ruins, which is why I had to revert to the backup in the first place. Sadly. =/

Thread and details concerning that can be found here.

SleePy

Any Mods installed?
Are you using a custom theme?
Any errors in the error logs? Apache, PHP, SMF?
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

zarth

Using the theme Exodus. I don't know if that's custom or not.

To my knowledge, we have a hard-coded addon-type of mod, to add support for a guild system, not using membergroups. Nothing shows up in the packages, so I assume anything we have is scripted manually.

SMF Error log shows nothing that's relevant to this. It's only the usual errors of "board # does not exist" for random members.
Apache and PHP logs... I don't have access to those, as we're on a shared server. But I can ask around.

Sarge

Download and open Sources/Admin.php, Themes/default/Admin.template.php and Themes/exodus/Admin.template.php (if present); if you can find that code in any of the files, post the file contents between [code] and [/code].

    Please do not PM me with support requests unless I invite you to.

http://www.zeriyt.com/   ~   http://www.galeriashqiptare.net/


Quote
<H> I had zero posts when I started posting

Advertisement: