wordpress nextGen gallery by code can not click next - php

i'am using wordpress and the nextGen Gallery plugin version 1.9.13 and i read out the galleries by code with this code:
$newnggShortcodes = new NextGEN_Shortcodes;
echo $newnggShortcodes->show_gallery( array("id"=>$currGalId,"template"=>"mygallery") );
this works fine, then i can click on the image and it pops up but then i can't click to next or previous image, it only pop up the one i have clicked.
when i check out the code, the rel tag is there, i looks like this:
<div id="ngg-gallery-10-112" class="ngg-galleryoverview">
<div id="ngg-image-256" class="ngg-gallery-thumbnail-box">
<div class="ngg-gallery-thumbnail">
<a class="cboxElement" rel="lightbox[set_10]" title=" " href="PATH-TO-IMAGE.jpg">
<img class="colorbox-manual" width="420" height="200" src="PATH-TO-IMAGE.jpg.jpg" alt="dsc_0007" title="dsc_0007">
</a>
</div>
</div>
<div id="ngg-image-257" class="ngg-gallery-thumbnail-box">
<div class="ngg-gallery-thumbnail">
<a class="cboxElement" rel="lightbox[set_10]" title=" " href="http://PATH-TO-IMAGE.jpg.jpg">
<img class="colorbox-manual" width="420" height="200" src="http://PATH-TO-IMAGE.jpg.jpg" alt="dsc_0008" title="dsc_0008">
</a>
</div>
</div>
when i use the [nggallery id=10] in the backend, the it works fine.
anyone a idea?
thanks!

I found the mistake, the problem was not nextGen Gallery, the problem was that i use the jquery colorbox and the colorbox recognized it as single picture.

Related

How do I change this php popup to a link?

I'm looking to change this bit of code to a link instead of having it appear as a small popup window. How would I change it to link to a page of "http://example.com/register" instead of having the registration window drop down?
<div class="login-wrapper">
<a id="sticky-login" class="info-bottom icon-login sticky-button" title="<?php _e('Login',IT_TEXTDOMAIN); ?>"></a>
<div class="sticky-form" id="sticky-login-form">
<div class="loading">
<div> </div>
</div>
<?php echo it_login_form(); ?>
</div>
</div>
This seems too easy so I'm probably missing something.
You'd add an href attribute to the <a> tag, and if javascript is creating the popup, remove either the id attribute from the <a> tag or the class to which the javascript is linked.
<a class="info-bottom icon-login sticky-button" title="<?php _e('Login',IT_TEXTDOMAIN); ?>" href="http://example.com/register"></a>

xampp php not importing css, images, but imports php files

I am trying to copy a website to my local machine. I have downloaded all the code, and things like page redirection, and importing work fine. But displaying images, css, and using javascript doesn't seem to work.
<?php
$root = $_SERVER['DOCUMENT_ROOT'];
include ($root . '/resources/config.php');
echo "$imagepath/user_suit.png";
?>
<div class="sidebar1">
<ul class="nav">
<li>
<div id="loginLink" class="menu" onmousedown="return false;" >
<img src="
<?php
echo $imagepath
?>/user_suit.png" width="15" height="14" alt="Member Login"> Member Login
</div>
</li>
</ul>
Welcome Guest!
</div>
<script type="text/javascript">
$("#loginLink").click(function(){
// load contact form onclick
$("#contentPane").hide();
$("#loadingPageGif").show();
$("#contentPane").load("
<?php
echo $server
?>/code/login/Studentlogin.php",
function() {
$("#loadingPageGif").hide();
$("#contentPane").fadeIn();
});
});
</script>
In this code, the embedded image does not load, and clicking on the link does nothing.
I can right click on the unloaded image, go to view image, and it correctly displays.
I can put echo lines in $root . '/resources/config.php' and they show up correctly.
The site I downloaded it from does not have these issues, so I am guessing it has something to do with xampp.
The browser adds http://, you should make that
<div id="loginLink" class="menu" onmousedown="return false;" > <img src="http://localhost:82/public_html/images/user_suit.png" width="15" height="14" alt="Member Login"> Member Login </div>

How to get URL from specific <img src=> and put into <a href=> for use with Lightbox

I have built a site for someone else who will be updating it via a CMS (CushyCMS). They wanted a lightbox gallery included. I want to be able to allow them to upload a new image and for that image url to be copied into the a tag so lightbox works.
So far I am able to do that, but the client has to ensure the file names and format are exactly the same as what I have set them to in the php code. Is there a way to get the img url from the img tag (possibly identifying it using an id attribute) and put it directly into the tag?
Heres what I have so far:
<?php
$src1 = "images/test1.jpg";
$src2 = "images/test2.jpg";
?>
<a href="<?php echo $src1?>" data-lightbox="group-1">
<img class="cushycms profile" name="image1" id="slideshow_image" src="images/test1.jpg"/></a>
<a href="<?php echo $src2?>" data-lightbox="group-1">
<img class="cushycms profile" id="slideshow_image" src="images/test2.jpg"/></a>
Many thanks!
You can do it with jQuery:
<a data-lightbox="group-1">
<img name="image1" src="images/test1.jpg" />
</a>
<script>
var img = $('img[name="image1"]');
var imgSrc = img.attr('src');
img.parent().attr('href', imgSrc);
</script>
If you have multiple images and want to automate this you can use the map function:
<a data-lightbox="group-1">
<img name="image1" src="images/test1.jpg" class="slideshow" />
</a>
<a data-lightbox="group-1">
<img name="image2" src="images/test2.jpg" class="slideshow" />
</a>
<a data-lightbox="group-1">
<img name="image3" src="images/test3.jpg" class="slideshow" />
</a>
<script>
$(".slideshow").map(function() {
$(this).parent().attr('href', this.src);
});
</script>
Assuming you use jQuery somewhere there, you could/should use a lightbox plugin, like this one here:
http://www.jacklmoore.com/colorbox/
Using the xamples there, you would then use:
(http://www.jacklmoore.com/colorbox/example1/)
$('a.gallery').colorbox({rel:'group-1'});
which would result in a lighbox gallery showing on "click" on any anchor with class "gallery" while the gallery would show all the elements pointed by "href" from all anchors of that have class="group-1" (so each anchor would be
although you have to include some files for jquery and the lightbox plugin, I think it will make your life much easier in the end.
Also not sure what your php level is, but the example code you have there asks for:
<?php
$images = array(
'images/test1.jpg',
'images/test2.jpg'
);
?>
<?php foreach($images as $i => $url): ?>
<a href="<?php echo $url?>" data-lightbox="group-1">
<img class="cushycms profile" name="image<?php echo $i+1 ?>" id="slideshow_image" src="<?php echo $url ?>"/>
</a>
<?php endforeach; ?>
Just in case you got more images there.

Easiest way for user to update slider and gallery images using Concrete5?

To create an editable pane in C5 I use the following between div tags so the user can simply use the content editor to add text. This works quite well:
<div class="myWrapper">
<?php
$a = new Area('WelcomeText');
$a->display($c);
?>
</div>
But what do I do when the mark-up is a little complicated? I would like to get user to update the 2 images and respective links themselves. Eg picture: http://i48.tinypic.com/4jma8p.png
What is the easiest way for non-code literate users to do this?
<ul class="Gal_2">
<li class="Frst">
<a href="<?php echo $this->getThemePath(); ?>/Images/TEMP_IMG2.jpg" rel="group">
<img src="<?php echo $this->getThemePath(); ?>/Images/TEMP_IMG2.jpg" width="224" height="150" alt="Island Rab" align="left" />
</a>
</li>
<li>
<a href="<?php echo $this->getThemePath(); ?>/Images/TEMP_IMG1.jpg" rel="group">
<img src="<?php echo $this->getThemePath(); ?>/Images/TEMP_IMG1.jpg" width="224" height="150" alt="Island Rab - Lopar beach" align="right" />
</a>
</li>
</ul>
Thanks in advance...
PC
Create a custom block with the free Designer Content addon: http://www.concrete5.org/marketplace/addons/designer-content
The block you create will have two image fields that link to other pages, and then use "static html" fields to surround the images with your <ul> and <li> tags.
This is actually a perfect use case for Designer Content, so it should be fairly self-explanatory. But if you run into problems, post a message to the support forum (or just email me directly at concrete#jordanlev.com).

PHP Fancybox same ID

This may seem like a weird request, but this is something I have to use based on something I have been provided that is live.
I have a voting system that uses an id for the voting button based on the entry id, so the code looks like:
<div class="like_wrap">
<div class="vot_plus" id="vt_img41"></div>
</div><!--like_wrap-->
This works how I need it to, however when you click the image within the vote it opens up a larger picture of the entry (again this works), but the client would like to add that vote to the fancybox popup. However when this is added it removes all references as it is calling the same ID twice. Any idea how I can get the voting button to appear on both, but actually look like it only appears once?
Here is the full code of an entry:
<div class="single ">
<a href='#inline41' rel='example_group' title='NAME GOES HERE'><img src='IMAGE GOES HERE' height='90' width='90' class='image' /></a>
<div class="right_col">
<h3>NAME GOES HERE</h3>
<div class="like_wrap"><div class="vot_plus" id="vt_img41"></div></div><!--like_wrap-->
</div><!--right_col-->
<div class="clear"></div><!--clear-->
<div id="inline41" style="display: none;">
<img src='IMAGE GOES HERE' height='400' class='image' /></a>
<div class="vote_bottom">
<p>Vote: </p>
<div class="like_wrap"><div class="vot_plus" id="vt_img41"></div></div><!--like_wrap-->
<div class="clear"></div><!--clear-->
</div><!--vote_bottom-->
</div>
</div><!--single-->
Any ideas how I can do this?
Thanks.

Categories