how to display images as gallery in a custom file

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
mansour
User
Posts: 282

how to display images as gallery in a custom file

Post by mansour »

Hi,
PHPMaker 2018.
I have a text field named as "photos" which accepts multiple photos uploading. (upload path for photos is : "pagephotos/")
I want to show the images as a gallery in a custom file. my table structure and custom file codes as below:

//// database table pages
CREATE TABLE pages (
PageID int(11) NOT NULL,
PageType tinyint(1) NOT NULL DEFAULT '1',
PageKey varchar(100) COLLATE utf8_unicode_ci NOT NULL,
PageTitle varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PageContent text COLLATE utf8_unicode_ci NOT NULL,
photos text COLLATE utf8_unicode_ci, // stores multiple photos for each record
PostDate datetime NOT NULL,
PageView bigint(20) DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=COMPACT;

//////custom file codes: page.php
<?php
$MyRow = ew_ExecuteRow("SELECT * FROM pages WHERE PageKey = '".$_GET['PageKey']."'");
?>
<div class="box">
<div class="box-header with-border">
<h2 class="box-title"><?php echo $MyRow['PageTitle']; ?></h2>
<div class="box-tools pull-right">
<!-- Collapse Button -->
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
<!-- /.box-tools -->
</div>
<!-- /.box-header -->
<div class="box-body">
<?php
$paginate = new Pagebreak();
$paginate->splitText($MyRow['PageContent']);
$paginate->setPage();
$paginate->getContent();
$paginate->getPageLinks();
?>
</div>
<!-- /.box-body -->
<div class="box-footer">Last Edit: <?php echo $MyRow['PostDate']; ?> Hits: <?php echo $MyRow['PageView']; ?>
</div>
<!-- box-footer -->
</div>
<!-- /.box -->

please add the required codes to my existing file (page.php)
thank you for your help.
Mansour


mobhar
User
Posts: 11660

Post by mobhar »

mansour wrote:
please add the required codes to my existing file (page.php)

What did you mean by "the required code"? Please explain it in more detail for more discussion.


mansour
User
Posts: 282

Post by mansour »

Hi,
As you can see "page.php" is a custom file that displays records of the "pages" Mysql table. I want to display photo gallery on this page.
e.g. : <?php echo $MyRow['photos']; ?>
As I mentioned before the photos field is a text field with multiple uploads ability.
I want to show photos on this custom page like the normal Phpmaker generated files. (pagesview.php, pageslist.php)
How can I do that? Please post a sample code!
Thank you
Mansour


mobhar
User
Posts: 11660

Post by mobhar »

mansour wrote:
I want to show photos on this custom page like the normal Phpmaker generated files.
(pagesview.php, pageslist.php)

Then just refer to the code in the generated .php script files.


mansour
User
Posts: 282

Post by mansour »

Hi,
I tried many times but I could NOT resolve the issue.
Any suggestion?
Your help highly appreciated!
Mansour


mobhar
User
Posts: 11660

Post by mobhar »

mansour wrote:
I tried many times but I could NOT resolve the issue.

Then please post your code for more discussion.


Post Reply