Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Pages: 1 [2] 3 4

Author Topic: ZenPhoto 1.2 integration with MU  (Read 9941 times)

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: ZenPhoto 1.2 integration with MU
« Reply #15 on: August 18, 2010, 01:51:06 AM »

Quick question... if you take this out of your index.php file...
Code: [Select]
define('WEBPATH', 'http://localhost/mywebsite/gallery'); require_once("gallery/zp-core/template-functions.php");... can you still access the Gallery by pasting http://localhost/mywebsite/gallery in your browser address bar?

With my installation, I just have a link to the Gallery in my navigation bar.

I should also note...
... (just checked my old mod-notes)... I did have the same problems with ZenPhoto 1.2.2 and did not use this integration approach. I keep ZenPhoto as a standalone install... in a snews-root/gallery directory... and basically duplicated the site's main theme and used it for a new ZenPhoto theme. That way it appears to be fully integrated with the rest of the site.
« Last Edit: August 18, 2010, 01:59:08 AM by Keyrocks »
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: ZenPhoto 1.2 integration with MU
« Reply #16 on: August 18, 2010, 02:15:40 AM »

Another question...
How do you have your Z-P d-base tables set up? Are they in the same d-base as your snews tables?
If so, have a look at my post on table-name prefixing when using a Z-P installation.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

alks

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 53
Re: ZenPhoto 1.2 integration with MU
« Reply #17 on: August 18, 2010, 12:11:53 PM »

Your idea about keeping it seperate may be an option - i could use the same design for it and just hard link to it. So they are both running independently but have the same design. If i did this i would not need to carry out any modifications to snews core apart from the hard link. However i would not get some  of the features from the original mod and i would have to hard link back to the snews index page from the gallery page. 

In answer to your question, Yes by "pasting http://localhost/mywebsite/gallery"  in my browser zen gallery works fine.

I Checked the table prefix and they were already zp_albums, zp_images, zp_ comments, zp_options from the default installation (1.1.4). btw, I did create a new database to hold them called zengallery, i did not add the tables to the snews database.

I'm tempted to use this (http://www.freitagmorgen.de/gallery) script and hard link to it as it creates its own thumbnails and re-sizes images on the fly, users could then just upload using snews upload and the page would look after itself.


thanks,

alks
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: ZenPhoto 1.2 integration with MU
« Reply #18 on: August 18, 2010, 03:16:50 PM »

For an example of sNews (1.6 MEMU) and ZenPhoto running independently on the same domain, with the site's main template copied and modified for use as the ZenPhoto template... so they both appear to be on the same site... here's the Home Page and here's the gallery's Albums Page.

You should be able to create a ZenPhoto theme that combines parts of the sNews index.php file with parts of the ZenPhoto theme's index.php file.
It's actually easier to integrate sNews into ZenPhoto than the other way around.  :)

As a reference, here's the contents of the index.php file for the callander theme in ZenPhoto.
This file is basically a copy of the default ZenPhoto theme's index.php with parts of the sNews index.php added to it.
I also modified the CSS stylesheet file for it to match the site's default theme colors.
I've added comments to show where the sNews parts were added into it and where the ZenPhoto template parts were retained.
Code: [Select]
<?php

<? session_start(); // from sNews index.php
include ('../snewsMU.php'); // from sNews index.php, with modified file-path
if (!defined('WEBPATH')) die();
$themeResult getTheme($zenCSS$themeColor'light'); $firstPageImages normalizeColumns('2''6');
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<?php  title(); // from sNews index.php ?>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="Robots" content="index,follow" />
<meta name="Generator" content="Municipality of Callander" />
<meta name="author" content="Keyrocks" />
<?php  favico(); // from sNews index.php ?>
<link rel="stylesheet" type="text/css" href="gallery/themes/callander/styles/callander.css" media="screen" />
<link rel="stylesheet" href="<?php echo  $zenCSS ?>" type="text/css" />
<?php zenJavascript(); ?>
<?php printRSSHeaderLink('Gallery',gettext('Gallery RSS')); ?>
</head>
<body>

<?php

// TOP SECTION - from sNews index.php file
echo '<div id="wrap">';
    echo 
'<div id="header">';
echo '<div class="title_tagline2"></div>';
    echo 
'</div>';

    echo 
'<div id="main_menu">';
echo '<div class="menu">';
    echo '<ul>'categories_dropdown(); echo '</ul>';
echo '</div>';
    echo 
'</div>';
    
    echo 
'<div id="subheader">';
echo '<div id="breadcrumbs">';
    echo '<b>Location:</b>&nbsp;';
    breadcrumbs();
echo '</div>';
echo '<div class="searchright">';
    searchform(image'sn_icons/searchform.png'''); /*searchform_def();*/
echo '</div>';
    echo 
'</div>';

    echo 
'<div id="content">';
echo '<div class="content_right">'// opens right content container
// END TOP SECTION of sNews index.php file

// MID-SECTION - from Gallery Template --------------------
        
echo '<div id="gallerytitle">';
            if (
getOption('Allow_search')) {  printSearchForm(''); }
            echo 
'<h2>';
    printHomeLink(''' | ');
    echo getGalleryTitle();
    echo '</h2>';
echo '</div>'// close gallerytitle

echo '<div id="albums">';
            while (
next_album()):
            echo 
'<div class="album">';
                echo 
'<div class="thumb"><a href="';
echo htmlspecialchars(getAlbumLinkURL());
echo '" title="';
echo gettext('View album:');
echo getAnnotatedAlbumTitle();
echo '">';
printAlbumThumbImage(getAnnotatedAlbumTitle());
echo '</a></div>'// close thumb

echo '<div class="albumdesc">';
echo '<h3><a href="';
echo htmlspecialchars(getAlbumLinkURL());
echo '" title="';
echo gettext('View album:');
echo getAnnotatedAlbumTitle();
echo '">';
printAlbumTitle(); // the text link under the gallery thumbnail
echo '</a></h3>';
echo '<small>'printAlbumDate(""); echo '</small>'// album created date string
echo '<p>'printAlbumDesc(); echo '</p>';
echo '</div>'// close albumdesc
    echo '<p style="clear: both;"></p>';
    echo '</div>'// close album
    endwhile;
echo '</div>'// close albums
# preview - page numbers - next
printPageListWithNav("&laquo; ".gettext("prev"), gettext("next")." &raquo;");
# END MID-SECTION - From Gallery Template ------------------------------------------

// BOTTOM SECTION - from sNews index.php file
 
echo '</div>'// closes div class content_right
    
echo '</div>'// closes div ide content

    
echo '<div id="bottom">';
echo '<div class="footer">';
     echo 
'<div class="footermenu">';
foot_catlist();
    echo '</div><br />&copy; ';
    echo date('Y');
    echo '&nbsp;';
    echo s('website_copyright');
echo '</div>'// close div class footer
    
echo '</div>'// close div id bottom
echo '</div>'// close div id wrap
// END BOTTOM SECTION from sNews index.php file ------------------------------------------

// END SECTION  - from Gallery Template ------------------------------------------ 
if (function_exists('printAdminToolbox')) printAdminToolbox();
?>

</body>
</html>

?>
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

alks

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 53
Re: ZenPhoto 1.2 integration with MU
« Reply #19 on: August 18, 2010, 04:19:05 PM »

Thanks, i think it will probably be the way to do it. Thanks you for the template example.
I dont think i will be able to solve the issues with the original mod quickly so i will give the option you propose a spin and see how it goes.
Of course there will be two admin login areas one for snews and one for zen gallery but i think it would be ok.

It would nice if there were a built into snews gallery but i have never seen one in the forums (yet....) although i did read about a bare bones package that luka posted  a few years back called snews gallery (or similar) but it was unfinished.

thanks,

alks
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: ZenPhoto 1.2 integration with MU
« Reply #20 on: August 18, 2010, 04:24:55 PM »

Rui Mendes was working on an sNews Gallery package too but I can't put my finder on a reference to it at the moment.
I know Rui is currently working somewhere in Quebec (Canada) these days and he still logs in now and then here.
Perhaps someone can ask him where his project is or if he is continuing with it... if we can locate his project thread.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

alks

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 53
Re: ZenPhoto 1.2 integration with MU
« Reply #21 on: August 18, 2010, 07:55:40 PM »

I've had a go at the intregation (i'm not familiar with zen gallery so time spent on the help section of that site)
I think it will work - but its very fiddely!
However now that i have included the snewsMU file so that i can retain snews functions within gallery page, zen gallery has now decided to use the database i am using for snews rather than than the database that was set up and working for zengallery.
It seams that i need to add the tables from the zengalley database to the snews database in order for it to work. I get an sql error otherwise saying that it cant find the tables.
I'm not sure why this is occuring but i assume that because im already using the snews database (via the include "snewsMU") it overides the connection to the zengallery database in the zen gallery itself. Not sure yet what i need to do in order to run both databases. But its all fun...........

 :-\ 

alks

Logged

alks

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 53
Re: ZenPhoto 1.2 integration with MU
« Reply #22 on: August 19, 2010, 12:47:40 PM »

Its was easy - its all coming back to me now!

To run both databases i just needed to reconnect and then disconnect to and from each database within the index.php file for zen gallery. i.e
Code: [Select]
<?php db_connect(); // reconnect to zenphoto db ?> just before the main content and then simply re-connect with the snews database after it. :)

alks
« Last Edit: August 19, 2010, 02:50:09 PM by alks »
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: ZenPhoto 1.2 integration with MU
« Reply #23 on: August 20, 2010, 08:09:31 PM »

I hope you get it so both sNews and Gallery work OK doing it your own way.
While gave you some examples of what I did... I had not given you all of the finer details involved... wo whatever you come up with may well turn out to be simpler than what any of us has come up with in the past.

Consider it a challenging adventure and a learning experience.
The good part is that you can always replace screwed-up code with what you have before you screwed it up... and start fresh again till you get what you want.  8)
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

alks

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 53
Re: ZenPhoto 1.2 integration with MU
« Reply #24 on: August 25, 2010, 01:45:36 PM »

Ok I am almost complete with my zen integration everythings fine (i even decided to add the tables to the snews database as it is much easier) except this problem :

The comments feature does not work properly when i  leave a message i get the message

"your comment was not sent
possible reasons: you left blank column, comment is too short or you havent entered the right math capture code"

this appears to be a defualt snews error message not an zen photo message, so is this a known issue with integrating? It appears to be a conflict of some sort, any idea?

thanks,

alks
Logged

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal
Re: ZenPhoto 1.2 integration with MU
« Reply #25 on: August 25, 2010, 04:49:57 PM »

Perhaps a bit late for this, and I wouldn't want to add any confusion at this stage since you seem to have the Zen Photo integration working apart from comments, but the main reason for me not bothering with the likes of Zen Photo is various integration issues like comments not working. Instead I've happily used this gallery provided by Codetwist back in '07: http://snewscms.com/forum/index.php?topic=6008.0

If you'd be at all interested in it, I have a developed version of it with a sorting toggle (off/on) and the ability to include more than one gallery in one single article (which was a special need of mine at one point). The best thing about this gallery - apart from it working with all versions of sNews from 1.5 and up - is that you can use it within sNews articles and/or pages, without any integration problems (comments work, rss feeds work etc) and image resizing controlled by CSS rather than javascript or php functions (which fits my needs perfectly).

(The developed version I have has only been tested with 1.7 - although it should reasonably work with older versions as well. The code in the linked post works with 1.5-1.7.)

As for your comment problems, I'm sorry but I don't have a good answer.
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: ZenPhoto 1.2 integration with MU
« Reply #26 on: August 25, 2010, 05:09:21 PM »

The comments feature does not work properly when i  leave a message i get the message
      "your comment was not sent - possible reasons: you left blank column, comment is too short or you havent entered the right math capture code"

this appears to be a defualt snews error message not an zen photo message, so is this a known issue with integrating? It appears to be a conflict of some sort, any idea?

I seem to remember having this problem when I integrated Z-P version 1.2.2 to run with 1.6.
I did find that prefixing the Z-P tables was necessary because both sNews and Z-P had comments tables.
I don't think there were any other comments conflicts but I will keep looking for a note on it and if I do find one, I'll be back!

In the meantime, you MAY need to make the following patch. (It's noted in step 4 here).
Both sNews and Z-P (v.1.2.2) were both using function strip() and we had to change the function references in snews.php from strip( to snews_strip( so the two would be uniquely different and not conflict.

The same would be required with sNews 1.7 so, search your snews.php file for strip( and change them to snews_strip(.
There are only 3 occurences of it... 2 being where the function is used to strip the title and text data within function rss_contents and the third being the function name itself.
« Last Edit: August 25, 2010, 05:14:45 PM by Keyrocks »
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

alks

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 53
Re: ZenPhoto 1.2 integration with MU
« Reply #27 on: August 25, 2010, 05:28:39 PM »

Thanks for the link to the script - i had not spotted this one while spending hours searching the forums. I think i will try it out at some point in the future as it could be very useful for other projects. Perhaps you could post your own updated script up somewhere also?

I still need to use zen photo for this project (since i've gone this far with it) as the users of the website really wanted a gallery that they could update easily on the fly themselves (in fact the whole website hense my use of whizziwig editor)

Unless anyone knows anything about he comment problems i will have to remove the feature. I have experimented by changing some of the varible names in snews and this resulted in a differnt error message - so some progress. However the comments are still not being added to the database so iv'e come to a halt with it for now.  Also i did notice that if i check the option to not use the zen photo captcha (under theme options) it causes a fatal error when the gallery is loaded - so perhaps there is a clue there?

thanks,

alls
Logged

alks

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 53
Re: ZenPhoto 1.2 integration with MU
« Reply #28 on: August 25, 2010, 05:38:18 PM »


I seem to remember having this problem when I integrated Z-P version 1.2.2 to run with 1.6.
I did find that prefixing the Z-P tables was necessary because both sNews and Z-P had comments tables.
I don't think there were any other comments conflicts but I will keep looking for a note on it and if I do find one, I'll be back!

In the meantime, you MAY need to make the following patch. (It's noted in step 4 here).
Both sNews and Z-P (v.1.2.2) were both using function strip() and we had to change the function references in snews.php from strip( to snews_strip( so the two would be uniquely different and not conflict.

Keyrocks, I have applied the patch and the snews tables were already prefixed "zp_comments" etc  when i installed the database. But the comments are still not working. It would be really good to get this feature working properly as it seams to be the only hicup with the installation.

(does the comments feature work on your installations?)

thanks,

alks

*Update*
I just checked my zp_comments table and there is a message in php myadmin :

PRIMARY      PRIMARY      0       Edit         id
imageid            INDEX    None      Edit     imageid
imageid_2    INDEX    None      Edit     imageid 

The following indexes appear to be equal and one of them should be removed: imageid, imageid_2

???

alks
« Last Edit: August 25, 2010, 06:01:49 PM by alks »
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: ZenPhoto 1.2 integration with MU
« Reply #29 on: August 25, 2010, 06:02:22 PM »

(does the comments feature work on your installations?)

No... I've only 2 clients using Zen-Photo and neither wanted any comments to their images so never used it there.
Also, have never used it on my local machine installations... though I am trying to figure out how it works on one (1.2.2 with sNews 1.6) now...

UPDATE.............
OK.... had to enable comments.  ::)
I entered a comment on my local machine installation and also on a liver server location.
In both locations, I got the same message you are getting so I am having the same problem.


« Last Edit: August 25, 2010, 06:47:25 PM by Keyrocks »
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU
Pages: 1 [2] 3 4