News:

Wondering if this will always be free?  See why free is better.

Main Menu

ezPortal

Started by SMFHacks.com Team, November 02, 2008, 10:10:03 AM

Previous topic - Next topic

vbgamer45

@mickjav try this file copy to themes/default css folder might require cache refresh in the browser
added min-width to all columns so hope it helps
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

mickjav

Worked A Treat Thanks

vbgamer45

Awesome added the fix to main release thanks to live627
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

mickjav

Wanted to learn php so thought I would Start With Something simple and work from there, It didn't go as planned  :o  :o

I wanted a php block to show the Latest galleries added for a specific id_parent

2 have 2 HTML blocks below the guest welcome here, Latest Artists Galleries Block
global $txt, $smcFunc, $scripturl

//Get the latest 4 Galleries
$dbquery = $smcFunc['db_query']('', '
        SELECT c.id_cat, c.image
    FROM ******_gallery_cat AS c
    WHERE c.id_parent = 35
        ORDER BY c.id_cat ASC
        LIMIT 4');

echo '<table border="0" Width="100%">
<tbody>
<tr>';

while($row = $smcFunc['db_fetch_assoc']($dbresult))
        {
         //Get Each Row
$cat_url = $scripturl . '?action=gallery;cat=' . $row['id_cat'];
echo  '<td style="text-align: center;"><a href="' . $cat_url . '"><img src="' . $row['image'] . '" alt="" /></a></td>'
        }

echo '</tr>
</tbody>
</table>'

Error I'm getting
Parse error: syntax error, unexpected '$dbquery' (T_VARIABLE), expecting ';' or ',' in /home/*****/public_html/charts/Sources/EzPortal2.php(2858) : eval()'d code on line 4

Fatal error: Exception thrown without a stack frame in Unknown on line 0

Thanks in advance for any help

All the best mick

mickjav

Just noticed I missed the last ; from the end Plus on the end of the picture link

mickjav

Found I had used multple lines incorrectly so updated.
global $txt, $smcFunc, $scripturl

//Get the latest 4 Galleries
$dbquery = $smcFunc['db_query']('', '
        SELECT c.id_cat, c.image
    FROM databasedreams_gallery_cat AS c
    WHERE c.id_parent = 35
        ORDER BY c.id_cat ASC
        LIMIT 4');

echo '<table border="0" Width="100%"><tbody><tr>';

while($row = $smcFunc['db_fetch_assoc']($dbresult))
        {
         //Get Each Row
$cat_url = $scripturl . '?action=gallery;cat=' . $row['id_cat'];
echo  '<td style="text-align: center;"><a href="' . $cat_url . '"><img src="' . $row['image'] . '" alt="" /></a></td>';
        }

echo '</tr></tbody></table>';

vbgamer45

Great job. I like to use a PHP IDE when writing code my preferred one is PHP Storm
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

mickjav

Quote from: vbgamer45 on June 12, 2022, 01:46:36 PMGreat job. I like to use a PHP IDE when writing code my preferred one is PHP Storm

This is what The php block diplays I have it set to admin.

You cannot view this attachment.

Plus still getting error

Parse error: syntax error, unexpected '$dbquery' (T_VARIABLE), expecting ';' or ',' in /home/*****/public_html/charts/Sources/EzPortal2.php(2858) : eval()'d code on line 4

Fatal error: Exception thrown without a stack frame in Unknown on line 0



Arantor

Your code is missing a ; on the end of the first line.

mickjav

#2029
Thanks @Arantor That gets the Block to display without errors just wont display anything

PHP BLOCK Latest

You cannot view this attachment.

Updated code
global $txt, $smcFunc, $scripturl;

//Get the latest 4 Galleries
$dbquery = $smcFunc['db_query']('', '
        SELECT c.id_cat, c.image, c.id_parent
    FROM *****_gallery_cat AS c
    WHERE c.id_parent = 35
        ORDER BY c.id_cat ASC
        LIMIT 4');

echo '<table border="0" Width="100%"><tbody><tr>';

while($row = $smcFunc['db_fetch_assoc']($dbresult))
        {
         //Get Each Row
$cat_url = $scripturl . '?action=gallery;cat=' . $row['id_cat'];
echo  '<td><a href="' . $cat_url . '"><img src="' . $row['image'] . '" alt="" /></a></td>';
        }

echo '</tr></tbody></table>';

vbgamer45

You are just displaying the filename with without the gallery url

do this
global $txt, $smcFunc, $scripturl, $modSettings, $boardurl;

if (empty($modSettings['gallery_url']))
$modSettings['gallery_url'] = $boardurl . '/gallery/';

//Get the latest 4 Galleries
$dbquery = $smcFunc['db_query']('', '
        SELECT c.id_cat, c.image, c.id_parent
    FROM *****_gallery_cat AS c
    WHERE c.id_parent = 35
        ORDER BY c.id_cat ASC
        LIMIT 4');

echo '<table border="0" Width="100%"><tbody><tr>';

while($row = $smcFunc['db_fetch_assoc']($dbresult))
        {
         //Get Each Row
$cat_url = $scripturl . '?action=gallery;cat=' . $row['id_cat'];
echo  '<td><a href="' . $cat_url . '"><img src="' . $modSettings['gallery_url']  . $row['image'] . '" alt="" /></a></td>';
        }

echo '</tr></tbody></table>';
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

mickjav

Thanks @vbgamer45 But Did check the Gallery_Cats table which the image Fields seems to store the full url I.E.

https://www.databasedreams.co.uk/images/Olivia_Rod...
Did Try The code but got same result Thanks for your help

mick

vbgamer45

My  mistake I thought we were trying to display picture. What page is that on?
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

mickjav

https://www.databasedreams.co.uk/charts/index.php

The Block is in between the "Latest Artists Analysis Block" And the block this php block is to replace "Latest Artists Galleries"

vbgamer45

Is the block visible with right permisisons.
Not seeing anything.
I would add an to see if anything is coming out of the block
echo 'test';
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

mickjav

You can use you "hostit" Account I'll update the perms if you remember the login details?

Also the echo displays

vbgamer45

This is what i see on the forum homepage.
It doesn't look like guests have permissions to view the block.
You cannot view this attachment.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

mickjav

Updated Should be able to see it now

vbgamer45

So is the goal of the code to show latest 4 images from image galleries then under the category of 35?
I see id_parent call. The code you have right now. Just gets the icon of sub categories under id_cat of 35
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

mickjav

Yes the Images are all sized 140 High And the sub Gallery 35 holds all Artists Galleries

It should match the HTML Block "Latest Artists Galleries".

thanks mick

Advertisement: