Page 1 of 1

how to display images as gallery in a custom file

Posted: Tue Feb 13, 2018 3:54 am
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


Re: how to display images as gallery in a custom file

Posted: Tue Feb 13, 2018 9:54 am
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.


Re: how to display images as gallery in a custom file

Posted: Tue Feb 13, 2018 12:28 pm
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


Re: how to display images as gallery in a custom file

Posted: Tue Feb 13, 2018 12:30 pm
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.


Re: how to display images as gallery in a custom file

Posted: Tue Feb 13, 2018 8:12 pm
by mansour

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


Re: how to display images as gallery in a custom file

Posted: Wed Feb 14, 2018 5:44 pm
by mobhar

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

Then please post your code for more discussion.