kamilpacaq / drydock

Automatically exported from code.google.com/p/drydock
0 stars 0 forks source link

Image visibility problems #68

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I don't know if this is only an issue in SQLite (I forget what it looked
like last time I checked MySQL's view) but I figured out why we don't get
images anymore.

We've got this:
http://code.google.com/p/drydock/source/browse/branches/drydock-june11-SQLITE-TE
ST-BUILD/tpl/drydock-image/viewblock.tpl#137

Where it wants to break up $post.images into it.name, it.fsize, whatever

The problem with that is that $post.images is an array that includes the
table names.

var_export (my new favorite function for debugging) gives me this for a
sample post:
array (
  0 => 
  array (
    0 => '1',
    'drydock_images.id' => '1',
    1 => '9b1db8856b4918cadefcc23b425ec42fa0fc6402',
    'drydock_images.hash' => '9b1db8856b4918cadefcc23b425ec42fa0fc6402',
    2 => '46b04019063ef.jpg',
    'drydock_images.name' => '46b04019063ef.jpg',
    3 => '722',
    'drydock_images.width' => '722',
    4 => '577',
    'drydock_images.height' => '577',
    5 => '_t46b04019063ef.jpg',
    'drydock_images.tname' => '_t46b04019063ef.jpg',
    6 => '150',
    'drydock_images.twidth' => '150',
    7 => '120',
    'drydock_images.theight' => '120',
    8 => '40',
    'drydock_images.fsize' => '40',
    9 => '0',
    'drydock_images.anim' => '0',
    10 => '1',
    'drydock_images.extra_info' => '1',
    11 => 'Created with: CREATOR: gd-jpeg v1.0 (using IJG JPEG v62),
quality = 80
<br />',
    'exif_text' => 'Created with: CREATOR: gd-jpeg v1.0 (using IJG JPEG
v62), quality = 80
<br />',
  ),
)

Okay, so, there are several options.
1) change all the templates to include a table that might not exist
2) change all the templates to take into consideration the table names
3) fix the problem at the source by changing the getimgs()/mymultiarray()
logic to assign the correct names (I think SQL command AS handles this?  Is
that right?)

Original issue reported on code.google.com by TaQS...@gmail.com on 1 Jul 2009 at 4:43

GoogleCodeExporter commented 8 years ago
        $querystring = "select "
                 . THimages_table .".hash as hash, "
                 . THimages_table .".name as name, "
                 . THimages_table .".width as width, "
                 . THimages_table .".height as height, "
                 . THimages_table .".tname as tname, "
                 . THimages_table .".twidth as twidth, "
                 . THimages_table .".theight as theight, "
                 . THimages_table .".fsize as fsize, "
                 . THimages_table .".anim as anim, "
                 . THextrainfo_table.".extra_info AS exif_text"
                 . " FROM ". THimages_table ." LEFT OUTER JOIN ".THextrainfo_table. " on "
                 . THimages_table.".extra_info = ".THextrainfo_table.".id WHERE "
                 . THimages_table.".id=".intval($imgidx);

Original comment by TaQS...@gmail.com on 1 Jul 2009 at 5:06

GoogleCodeExporter commented 8 years ago
                 . THimages_table .".id as id, "

Original comment by TaQS...@gmail.com on 1 Jul 2009 at 5:09

GoogleCodeExporter commented 8 years ago

Original comment by TaQS...@gmail.com on 8 Jul 2009 at 3:56