|
|||||||
![]() |
Forum Index > glFusion > glFusion Add-on, Plugin Support |
|
|
{album_title} in Random Image Block
|
|||
| | | Printable Version |
|
ofey | ||||||||
|
Hi, PHP Formatted Code {# begin {templatelocation} #}{framecss} <div class="mgPluginMI"> <table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin:0px auto;"> <tr> <td align="center" style="vertical-align:middle;"> {media_thumbnail} </td> </tr> <tr> <td style="text-align:center;"> <div class="pluginSmallText">{media_title}</div> <!--- <a href="{url_album}">{lang_browse_album}</a> ---> <a href="{url_album}">{album_title}</a> </td> </tr> </table> </div> {# end {templatelocation} #}
|
![]() Active Member ![]() Group Comfort Level:: +3 ![]()
Registered: 02/19/06 |
||||||||
|
|||||||||
|
Manny | ||||||||
|
Shane The best gardens are made not by planting more flowers but by picking more weeds. |
![]() Regular Member Group Comfort Level:: +3 ![]() ![]()
Registered: 03/07/08 |
||||||||
|
|||||||||
|
Mark | ||||||||
|
Unfortunately, the template variables must be defined in the code. So when you used {album_title}, it doesn't display anything because the PHP code never defined it. We woud need to modifiy the SQL that pulls the information since the album title is not actually known or used by the random image functions. glFusion - Enhanced Content Management |
![]() Admin Group Comfort Level:: +104 ![]() ![]()
Registered: 10/21/05 |
||||||||
|
|||||||||
|
ofey | ||||||||
|
Mark, |
![]() Active Member Group Comfort Level:: +3 ![]()
Registered: 02/19/06 |
||||||||
|
|||||||||
|
ofey | ||||||||
|
Mark, |
![]() Active Member ![]() Group Comfort Level:: +3 ![]()
Registered: 02/19/06 |
||||||||
|
|||||||||
|
lgarner | ||||||||
|
In the query. Here's how I did it: |
![]() Admin Group Comfort Level:: +51 ![]() ![]()
Registered: 06/10/08 |
||||||||
|
|||||||||
|
ofey | ||||||||
|
Igarner, PHP Formatted Code 'lang_browse_album' => htmlspecialchars($row['album_title']),
PHP Formatted Code $sql = "SELECT ma.album_id,m.media_id,m.media_filename,m.media_title,a.album_title FROM {$_TABLES['mg_albums']} as a LEFT JOIN {$_TABLES['mg_media_albums']} as maon a.album_id=ma.album_id LEFT JOIN {$_TABLES['mg_media']} as m on ma.media_id=m.media_id WHERE m.media_type=0 AND a.enable_random=1 AND a.hidden=0 " . COM_getPermSQL('and') . " ORDER BY " . $randomSelect . " LIMIT 1";
|
![]() Active Member Group Comfort Level:: +3 ![]()
Registered: 02/19/06 |
||||||||
|
|||||||||
|
ofey | ||||||||
|
Am I being stupid here |
![]() Active Member ![]() Group Comfort Level:: +3 ![]()
Registered: 02/19/06 |
||||||||
|
|||||||||
|
lgarner | ||||||||
|
Yes, you have it right. htmlspecialchars() is a function to escape characters that are "special' to HTML: >, <, etc. It may not be required here, but I wasn't sure. |
![]() Admin Group Comfort Level:: +51 ![]() ![]()
Registered: 06/10/08 |
||||||||
|
|||||||||
|
ofey | ||||||||
|
Igarner, PHP Formatted Code {# begin {templatelocation} #}{framecss} <div class="mgPluginMI"> <table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin:0px auto;"> <tr> <td align="center" style="vertical-align:middle;"> {media_thumbnail} </td> </tr> <tr> <td style="text-align:center;"> <div class="pluginSmallText">{media_title}</div> <a href="{url_album}">{lang_browse_album}</a> </td> </tr> </table> </div> {# end {templatelocation} #}
|
![]() Active Member ![]() Group Comfort Level:: +3 ![]()
Registered: 02/19/06 |
||||||||
|
|||||||||
|
ofey | ||||||||
|
By the way the random_block_anon.thtml is like this, PHP Formatted Code {# begin {templatelocation} #}{framecss} <div class="mgPluginMI"> <table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin:0px auto;"> <tr> <td align="center" style="vertical-align:middle;"> {media_thumbnail} </td> </tr> <tr> <td style="text-align:center;"> <div class="pluginSmallText">{media_title}</div> <!--- <a href="{url_album}">{lang_browse_album}</a> ---> {lang_browse_album} </td> </tr> </table> </div> {# end {templatelocation} #}
|
![]() Active Member Group Comfort Level:: +3 ![]()
Registered: 02/19/06 |
||||||||
|
|||||||||
|
ofey | ||||||||
|
Igarner, |
![]() Active Member ![]() Group Comfort Level:: +3 ![]()
Registered: 02/19/06 |
||||||||
|
|||||||||
|
| All times are CDT. The time is now 07:33 pm. |
|
|