News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

Highslide 4 SMF

Started by Spuds, May 01, 2010, 01:03:29 PM

Previous topic - Next topic

Eudemon

#180
spuds i need ur help
i got this sliding code from tinyportal
// Configurable Graphics block
// for use with TinyPortal 1.0 Beta5
// for use with Aeva multimedia mod for SMF
// by BlueSteel 18th April 2010
// @TinyPortal : http://www.tinyportal.co.uk/index.php?topic=32504.0
// Scrolling Options - on/off direction, speed, delay
// Item display options Random/Newest, number of item to display,selectable albums

// Marquee script Variables
$marq_offon = 1;                        // 0=off 1=on
$marq_behavior = "scroll";         // what should marquee do "scroll"
$marq_direction = "up";            // "left" , "right" , "up", "down"
$marq_height = "500px";            // size of viewable block area
$marq_scrolldelay = 10;            // delay iteritions
$marq_scrollamount = 1;         // how many pixels to scroll block each iteration
$marq_onmouseover = "this.stop()"; // what to do on mouseover
$marq_onmouseout = "this.start()";  // what to do on mouseout

// Aeva script variables
// - Gets items : array aeva_getMediaItems(int start, int limit, string sort, bool all_albums, array albums, string custom)
$aeva_start = 1;                   // where item number to start at
$aeva_limit = 30;                  // maximum number of items to display
$aeva_sort = 'm.time_added DESC';  // sort see Aeva-Subs.php for values I use 'RAND()' or 'm.time_added DESC' DESC or ASC for sorting order
$aeva_all_albums = true;           // all albums .. true or false 
$aeva_albums = array();            // for a single album put eg: array(10) for an array of albums eg: array(3,5,7) for all albums eg:array()
$aeva_custom ='m.id_media';        // aeva custom string
// - Creates HTML for viewing items : string aeva_listItems(array items, bool in_album = false, string align, int per_line)
$aeva_in_album = false;            // unknown paramiter .. set to false by default for now 
$aeva_align = 'center';            // allign items 'left' 'center' 'right'
$aeva_per_line = 1;                // number of colums to display at once eg: 1 for single .. 3 for 3 items accross

global $sourcedir;   
require_once($sourcedir . '/Aeva-Subs.php');   

// -------------------------------------
// Don't edit anything below this line
// -------------------------------------

// Start marquee routine if set to do so
if ($marq_offon == 1){
echo '<marquee behavior=',$marq_behavior,' direction=',$marq_direction,' height=',$marq_height,' scrolldelay=',$marq_scrolldelay,' scrollamount=',$marq_scrollamount,' onmouseover=',$marq_onmouseover,' onmouseout=',$marq_onmouseout,' >';
}
// end marquee routine

// start actual block to be displayed
    echo '<div style="width: 100% height:',$marq_height,'; overflow: hidden;">';
    echo aeva_listItems(aeva_getMediaItems($aeva_start,$aeva_limit,$aeva_sort,$aeva_all_albums,$aeva_albums,$aeva_custom),$aeva_in_album,$aeva_align,$aeva_per_line);
    echo '</div>';
// end actual block to be displayed

//start marquee routine   
if ($marq_offon == 1){
echo'</marquee>';
} //end scrolling routine

and then i applied it to my portal block
it's sliding fine but when i click on it, and pops up highslide
the buttons ("zoom" "detail") are there but it's not showing
it looks like they are overlapped by something, how do i fix it?
u can check it on my site: www.kumakuni.com (right side first block)

thx

Spuds

Humm ... Off the top of my head its probably one of two things

1) The caption text color in the hs4smf admin panel is set to white FFFFFF

-or-

add this to the end of the highslide.css file (themes/default/hs4smf/highslide.css) and see if that fixes the issue

.highslide-caption {
display: none;
border-top: none;
font-size: 1em;
color: black;
padding: 5px;
background-color: white;
}


If neither of those work then I'll need to do some more thinking.

Eudemon

tried, doesn't work
let me show an example just to make it clear
22222 is screenshot of the view in media
11111 is when click it on the block
the link is there, as i can click it, but just not showing

Spuds

Yup I understand what you are saying ... I can see the links in the html they are just not showing ... that's why I thought
a) foreground / background colors might the same (white) or
b) a missing css class.

I just went to the site and don't see the css edit, so I guess you tried it (cleared your cache) and it did not work?  If so try it again but remove the display: none; ... Highslide should do this when it loads but since the slideshow is built with Aeva we just need to to fully work with hs4smf.

I'll add this to my test site to see if I can reproduce the problem to give you a better answer.

Eudemon

alright thx

and yeah, i tried the codes it didn't work so i removed it..

Spuds

OK here is the deal, I forgot that I had intentionally hidden those items !  The reason was when you are using smg tags and have enabled the hs4smf caption/heading text, then you can end up with overlapped text in the caption which looks bad.

I can probably put some additional checking in this area of the code, need to think about as there is no straight forward way to do this, to many options.

Anyway for this case, in hs4smf-Subs file find around line 1113
Code (find) Select
var slideOptions = { slideshowGroup: \'aeva\', align: \'center\', useControls: false, transitions: [\'expand\', \'crossfade\'], fadeInOut:true, captionOverlay: {opacity:0}, headingOverlay: {opacity:0} };


and replace it with

Code (replace) Select
var slideOptions = { slideshowGroup: \'aeva\', align: \'center\', useControls: false, transitions: [\'expand\', \'crossfade\'], fadeInOut:true };


Eudemon

thx, that fixed it

btw the sliding codes, is it possible to change them to
display 2 images or some pixels of stuff and then start sliding
instead of start sliding from nothing (or when the block is blank)

Spuds

#187
Quote from: Eudemon369 on March 20, 2011, 05:35:38 PM
thx, that fixed it

btw the sliding codes, is it possible to change them to
display 2 images or some pixels of stuff and then start sliding
instead of start sliding from nothing (or when the block is blank)

Glad that worked ...

Had some time to think about this and I'm going to attach a test version of the hs4smf-Subs.php file.  This version attempts to honor the title/description that aeva places in the hidden div but still apply hs4smf styling to aeva slides.

When used in a message for example an smg tag will slide and show the aeva information even when you have set hs4smf caption to show the message subject.  If you also have an attachment in that same message it will show the message subject for that attachment caption while the aeva image will still show whatever aeva set up for it.  They will both be part of the same slideshow if you have that option set. 

Not sure on the transition item your asking about, I don't think highslide has any option for that.

Eudemon

#188
// Configurable Graphics block
// for use with TinyPortal 1.0 Beta5
// for use with Aeva multimedia mod for SMF
// by BlueSteel 18th April 2010
// @TinyPortal : http://www.tinyportal.co.uk/index.php?topic=32504.0
// Scrolling Options - on/off direction, speed, delay
// Item display options Random/Newest, number of item to display,selectable albums

// Marquee script Variables
$marq_offon = 1;                        // 0=off 1=on
$marq_behavior = "scroll";         // what should marquee do "scroll"
$marq_direction = "up";            // "left" , "right" , "up", "down"
$marq_height = "500px";            // size of viewable block area
$marq_scrolldelay = 10;            // delay iteritions
$marq_scrollamount = 2;         // how many pixels to scroll block each iteration
$marq_onmouseover = "this.stop()"; // what to do on mouseover
$marq_onmouseout = "this.start()";  // what to do on mouseout

// Aeva script variables
// - Gets items : array aeva_getMediaItems(int start, int limit, string sort, bool all_albums, array albums, string custom)
$aeva_start = 0;                   // where item number to start at
$aeva_limit = 30;                  // maximum number of items to display
$aeva_sort = 'RAND()';  // sort see Aeva-Subs.php for values I use 'RAND()' or 'm.time_added DESC' DESC or ASC for sorting order
$aeva_all_albums = true;           // all albums .. true or false 
$aeva_albums = array();            // for a single album put eg: array(10) for an array of albums eg: array(3,5,7) for all albums eg:array()
$aeva_custom ='m.id_media';        // aeva custom string
// - Creates HTML for viewing items : string aeva_listItems(array items, bool in_album = false, string align, int per_line)
$aeva_in_album = false;            // unknown paramiter .. set to false by default for now 
$aeva_align = 'center';            // allign items 'left' 'center' 'right'
$aeva_per_line = 1;                // number of colums to display at once eg: 1 for single .. 3 for 3 items accross

global $sourcedir;   
require_once($sourcedir . '/Aeva-Subs.php');   

// -------------------------------------
// Don't edit anything below this line
// -------------------------------------

// Start marquee routine if set to do so
if ($marq_offon == 1){
echo '<marquee behavior=',$marq_behavior,' direction=',$marq_direction,' height=',$marq_height,' scrolldelay=',$marq_scrolldelay,' scrollamount=',$marq_scrollamount,' onmouseover=',$marq_onmouseover,' onmouseout=',$marq_onmouseout,' >';
}
// end marquee routine

// start actual block to be displayed
    echo '<div style="width: 100% height:',$marq_height,'; overflow: hidden;">';
    echo aeva_listItems(aeva_getMediaItems($aeva_start,$aeva_limit,$aeva_sort,$aeva_all_albums,$aeva_albums,$aeva_custom),$aeva_in_album,$aeva_align,$aeva_per_line);
    echo '</div>';
// end actual block to be displayed

//start marquee routine   
if ($marq_offon == 1){
echo'</marquee>';
} //end scrolling routine


i'm talking about this code, it starts when the block is empty
and then the first image started to sliding up
but i want it to show 2 images on the block and then start sliding up the 3rd one

just asking if u have any idea, or i will try to contact the author

and thx for the hs code changes spuds, ur a great help
btw i think by applying the same effect of ur mod to aeva fixed the counting problem ::)

Spuds

Quote from: Eudemon369 on March 20, 2011, 06:08:17 PM
i'm talking about this code, it starts when the block is empty
and then the first image started to sliding up
but i want it to show 2 images on the block and then start sliding up the 3rd one
I don't believe you can do that with this block of code ... Its basically just using a standard HTML Marquee command, to do what you want would require some more advanced code I believe.

Quote
btw i think by applying the same effect of ur mod to aeva fixed the counting problem ::)
Are you referring to aeva not increasing the image view counter when its clicked (highslided) in a message / portal block?

Eudemon

QuoteI don't believe you can do that with this block of code ... Its basically just using a standard HTML Marquee command, to do what you want would require some more advanced code I believe.
ok, i will try to reach the author
QuoteAre you referring to aeva not increasing the image view counter when its clicked (highslided) in a message / portal block?
yea, it used to count only when the image is not in the user's cache
so it won't count any click after that from the same user

but now it's counting for every click, which is a good thing

Eudemon


dembow

hi, first of all thank you for this great mod, love it!
everything is working great only thing is that i'm getting this error in the log:

http://mysite.com/index.php?action=admin;area=logs;sa=errorlog;desc
8: Undefined index: hs4smf_headingsource
File: /home/mysite/public_html/Sources/hs4smf-Subs.php
Line: 737

how can i fix this?   :-\

Spuds

QuoteFile: /home/mysite/public_html/Sources/hs4smf-Subs.php
Line: 737

Try the following ... in hs4smf-Subs.php
Code (find) Select
$oheader = (($modSettings['hs4smf_slideshownumbers'] == 1) || ($modSettings['hs4smf_headingsource'] != 0 && $modSettings['hs4smf_headingposition'] == 1));
$ocaption = (($modSettings['hs4smf_slideshownumbers'] == 2) || ($modSettings['hs4smf_captionsource'] != 0 && $modSettings['hs4smf_captionposition'] == 1));

Code (replace) Select
$oheader = (($modSettings['hs4smf_slideshownumbers'] == 1) || (!empty($modSettings['hs4smf_headingsource']) && $modSettings['hs4smf_headingposition'] == 1));
$ocaption = (($modSettings['hs4smf_slideshownumbers'] == 2) || (!empty($modSettings['hs4smf_captionsource']) && $modSettings['hs4smf_captionposition'] == 1));


dembow

yes! that fixed it, many thanks spuds   :D

Eudemon

hey, spuds

do u think it is possible to
show highslide and load image at the same time?
instead of wait til it finished loading and then HS pops up (for aeva)
for example:
http://kumakuni.com/index.php?action=media;sa=album;in=9
i have got some big images, try to click on one, and then click "view larger size"
i want it to pop up hs and load from top to bottom at the same time
just like when u open a big image on a new tab

also how do i disable automatic re-size to fit screen function?

thx

dembow

^^^ that's a great idea

i use to preload certain images on certain pages of websites i make, like:


<body onload="MM_preloadImages('images/loadThis.png','images/loadThat.png')">


with this js script:


function MM_preloadImages() {
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


but i wouldn't even know where to start on how to add that to the mod lol  :P

Xarcell

I have a problem of the controls not showing up. I have sideshow enabled, and have played with the other settings.

I think the issue may be related to my custom Display.template.php file. I have 2 instances of if ($attachment['is_image'])
{
if ($attachment['thumbnail']['has_thumb'] && !empty($modSettings['hs4smf_enabled']) && !empty($modSettings['hs4smf_enableonattachments']))
{
$settings['hs4smf_img_count'] = (isset($settings['hs4smf_img_count'])) ? $settings['hs4smf_img_count'] + 1 : 1;
$slidegroup = hs4smf_get_slidegroup($message['id']);
echo '
<a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" class="highslide" onclick="return hs.expand(this, ' . $slidegroup . ')"><img src="', $attachment['thumbnail']['href'], '" alt="' , $attachment['name'] , '" id="thumb_', $attachment['id'], '" border="0" /></a><br />';
}
elseif ($attachment['thumbnail']['has_thumb'])
echo '
<a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" onclick="', $attachment['thumbnail']['javascript'], '"><img src="', $attachment['thumbnail']['href'], '" alt="" id="thumb_', $attachment['id'], '" border="0" /></a><br />';
else
echo '
<img src="' . $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '" border="0" /><br />';
}



Reason for that is my first post has a different layout than replies. There is a slot of this code for the first post, and a slot for replies. Anyway to fix this?

Arantor

Make the code distinct so the first slot doesn't exactly match?
Holder of controversial views, all of which my own.


Xarcell

NVM, I figured it out.

After looking at the install.xml, I realized this was missing from the display template:

// HS4SMF decide which slidegroup the attacments belong in
if (isset($modSettings['hs4smf_enableonattachments']) && isset($modSettings['hs4smf_enabled']))
hs4smf_track_slidegroup($message['id']);


I don't know why it didn't show as an error on install. It's All better now...

Advertisement: