Main Menu
collapse

Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

User Info

Welcome Guest.
Please log in.

Who's Online

  • Dot Guests: 977
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]


Blocks speak! Do you have an interest in getting more blocks - or even making your own? The Blocks Board is for you!

hmm...about php block

Started by Eudemon, April 23, 2011, 11:24:27 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Eudemon

#20
just for a better understand, here is the entire codes of the block

code removed


for some reason the for loop of $slide is only showing one image
(above and below //loop image comment)
btw how do i highlight something that's in code view

<---see last post for shorter version

?also offer free SMF support and customization?

[SiNaN]

#21
Code (Find) Select
$slide=array();
$num=-1;
foreach ($items as $item){
        $num=$num+1;
$slide= array( $num => '<a href="', $galurl, 'sa=item;id=', $item['id'], '"><img src="', $galurl, 'sa=media;id=', $item['id'], ';preview" alt="" />
                <span>', $item['title'],'</span></a>' );
}

foreach ($items_t as $item_t){
        $num=$num+1;
        $slide = array ( $num => '<a href="', $item_t['href'], '">', !empty($item_t['image']) ? '<img src ="'.$item_t['image'].'" title="'.$row['subject'].'" alt="" /><span>'. $item_t['title']. '</span>' : 'No Image' , '</a>' );
}

shuffle($slide);

//loop images

echo'<script type="text/javascript" src="http://www.kumakuni.com/coin-slider/jquery-1.5.2.min.js"></script>
<script type="text/javascript" src="http://www.kumakuni.com/coin-slider/coin-slider.min.js"></script>
<link rel="stylesheet" href="http://www.kumakuni.com/coin-slider/coin-slider-styles.css" type="text/css" />';

echo" <div id='coin-slider'><center>";

for($i=0;$i<$num;$i++)
    echo $slide[$i];

   echo '</center></div>';
echo'<script type="text/javascript">
    $(document).ready(function() {';
echo"        $('#coin-slider').coinslider();
    });
</script>";


Code (Replace) Select
$slide = array();
foreach ($items as $item)
$slide[] = '<a href="' . $galurl . 'sa=item;id=' . $item['id'] . '"><img src="' . $galurl . 'sa=media;id=' . $item['id'] . ';preview" alt="" /><span>' . $item['title'] . '</span></a>';
foreach ($items_t as $item)
$slide[] = '<a href="' . $item_t['href'] . '"><img src="' . $item_t['image'] . '" title="' . $row['subject'] . '" alt="" /><span>' . $item_t['title'] . '</span></a>';
shuffle($slide);

echo'
<script type="text/javascript" src="http://www.kumakuni.com/coin-slider/jquery-1.5.2.min.js"></script>
<script type="text/javascript" src="http://www.kumakuni.com/coin-slider/coin-slider.min.js"></script>
<link type="text/css" rel="stylesheet" href="http://www.kumakuni.com/coin-slider/coin-slider-styles.css" />
<div id="coin-slider" style="text-align: center;">', implode('', $slide), '</div>
<script type="text/javascript">
$(document).ready(function() {
$('#coin-slider').coinslider();
});
</script>';
And slowly, you come to realize... It's all as it should be...

Eudemon

#22
that works! thank you [SiNaN]
you can take a look of the slide show on my portal page, through the link on my signature

btw can u remove the url path for the js and css from both codes

again, thank you for ur support, i'm a freshman computer science college student
still learning new things about programming
but i'll try my best to help out the simple portal support board for return if i have time

?also offer free SMF support and customization?

yaosurfer

Hello
I dont want to start a new topic as this one is the most relevant to the situation im in right now.
Im trying to implement exactly the same slider.
3 files are loaded onto my server - css, .min.js plus js library
Now im trying to run the code you have supported (obviously with replaced path to files) and unfortunately im getting error in php block$slide = array();
foreach ($items as $item)
$slide[] = '<a href="' . $galurl . 'sa=item;id=' . $item['id'] . '"><img src="' . $galurl . 'sa=media;id=' . $item['id'] . ';preview" alt="" /><span>' . $item['title'] . '</span></a>';
foreach ($items_t as $item)
$slide[] = '<a href="' . $item_t['href'] . '"><img src="' . $item_t['image'] . '" title="' . $row['subject'] . '" alt="" /><span>' . $item_t['title'] . '</span></a>';
shuffle($slide);

echo'
<script type="text/javascript" src="http://mydomain/forum/themes/slider/jquery-1.6.4.js"></script>
<script type="text/javascript" src="http://mydomain/forum/themes/slider/coin-slider.min.js"></script>
<link type="text/css" rel="stylesheet" href="http://mydomain/forum/themes/slider/coin-slider-styles.css" />';
<div id="coin-slider" style="text-align: center;">', implode('', $slide), '</div>
<script type="text/javascript">
$(document).ready(function() {
$('#coin-slider').coinslider();
});
</script>';


error message is:

Parse error: syntax error, unexpected '}', expecting ',' or ';' in /html/forum/Sources/PortalBlocks.php(3351) : eval()'d code on line 16


BTW do I have to implement or upload any other codes or files?

Thank you

Blue

Here, try this:

<?php$slide = array();foreach ($items as $item)	$slide[] = '<a href="' . $galurl . 'sa=item;id=' . $item['id'] . '"><img src="' . $galurl . 'sa=media;id=' . $item['id'] . ';preview" alt="" /><span>' . $item['title'] . '</span></a>';foreach ($items_t as $item)	$slide[] = '<a href="' . $item_t['href'] . '"><img src="' . $item_t['image'] . '" title="' . $row['subject'] . '" alt="" /><span>' . $item_t['title'] . '</span></a>';shuffle($slide);echo'<script type="text/javascript" src="http://mydomain/forum/themes/slider/jquery-1.6.4.js"></script><script type="text/javascript" src="http://mydomain/forum/themes/slider/coin-slider.min.js"></script><link type="text/css" rel="stylesheet" href="http://mydomain/forum/themes/slider/coin-slider-styles.css" /><div id="coin-slider" style="text-align: center;">', implode('', $slide), '</div><script type="text/javascript">	$(document).ready(function() {		$("#coin-slider").coinslider();	});</script>';
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.