Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest sNews - sNews 1.7 - with its own forums - for discussion and user mods.

Pages: [1] 2 3 4

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

steerpike

  • Newbie
  • *
  • Karma: 13
  • Posts: 38
ZenPhoto 1.2 integration with MU
« on: September 06, 2008, 06:51:06 PM »

Hi.. I am trying to get this mod:

http://snewscms.com/forum/index.php?topic=5729.0

to work with MU.  However, I am using the latest version ZenPhoto (1.2).  I am not having too much luck.  When I try to load the snewsMU index I get a blank screen, which I am sure has to do with the first modded line in the sNewsMU index file:

code:

<?php session_start(); include('snewsMU.php'); define('WEBPATH', 'gallery'); require_once("gallery/zp-core/template-functions.php"); ?>

I am using a linux server.. this should not have any effect on the WEBPATH value I don't think.  I wouldn't have to use "/home/......" would I?

Anyway... If anyone has any thoughts on the whole gallery mod situation.. like would using Rui's system be better, and would it work with MU.. etc etc

If anyone is interested in having a look at my attempt, I've zipped it up here:

http://brownconnection.net/zzz/steerpike_zen1.2_attempt.zip     ;D

Thanks all!
« Last Edit: September 06, 2008, 07:49:32 PM by steerpike »
Logged

lessismore

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 67
Re: ZenPhoto 1.2 integration with MU
« Reply #1 on: September 06, 2008, 10:14:53 PM »

I'd certainly try using the fully-qualified pathname first.

I am using a linux server.. this should not have any effect on the WEBPATH value I don't think.  I wouldn't have to use "/home/......" would I?
Logged

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: ZenPhoto 1.2 integration with MU
« Reply #2 on: September 07, 2008, 01:38:53 AM »

1. I installed your package in localhost/steerpike/ and created database for snewsMU.
2. Launched for first time and get an error of not setting ZenPhoto....
3. Edited .htaccess file from gallery subfolder (RewriteBase /steerpike/gallery)
4. Chmoded 777 albums and cache subfolders of gallery.
5. Edited zp-config.php.source file and saved as zp-config.php
6. Launched http://localhost/steerpike/gallery/zp-core/setup.php (and setup done!)
7. Launced main site (http://localhost/steerpike/ and first page of sNewsMU appeared (nice theme BTW)

I not saw any ZenPhoto function included in your index.php of sNewsMU package (not the one from gallery). I not saw a .htaccess for sNewsMU included in your package so I did not made any steps further.

Anyway, at this stage, ZenPhoto is configured, sNewsMU is working (the homepage) but need .htaccess file and ZendPhoto functions included in index.php.

In index.php, first line is this:
<?php session_start(); include('snewsMU.php'); define('WEBPATH', 'http://localhost/steerpike/gallery'); require_once("gallery/zp-core/template-functions.php"); ?>

but I can't test it without missing steps (.htaccess file and zen functions included in index.php). Note: I did not worked with ZenPhoto until now.

-------------------------------
P.S. I'm working on Ubuntu 8.04
« Last Edit: September 07, 2008, 01:45:59 AM by funlw65 »
Logged

steerpike

  • Newbie
  • *
  • Karma: 13
  • Posts: 38
Re: ZenPhoto 1.2 integration with MU
« Reply #3 on: September 07, 2008, 03:05:41 AM »

Hi Funlw65,

Thanks a lot for looking at that!

Well, the instructions in the mod said to install zenphoto normally, then to make that adjustment to the first line of the snews index file.

Then the rest of the instructions were basically to copy the default theme found in /gallery/themes and then name it snews..

then make modifications to the index.php, album.php, and image.php files found in that new copy of the default theme.  So you are basically just adding your template to the zen photo files instead of the other way around.

It probably does have to do with that first line in the snews index file though.  Getting that path right.

Thanks for your help..  boy integrating a gallery is not the easiest thing!
Logged

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: ZenPhoto 1.2 integration with MU
« Reply #4 on: September 07, 2008, 12:24:03 PM »

Hi steerpike,
Don't use step nr. 9 from EQ's mod , is not working because of 3 reasons:
 1. show_latest_images function call zp_conf function which not exist
 2. function getRandomImages() is already defined (or maybe you introduced them already...)
 3. function getURL is already defined

The corrected code inserted in sidebar of index.php (snewsMU) is this:

Code: [Select]
<h2>New images:</h2>
<ul>
<?php/* show_latest_images(4); */?>

</ul>

<h2>Random image:</h2>
<?php $randomImage getRandomImages(); $randomImageURL getURL($randomImage); print "<a href='".getURL($randomImage)."' title='Random Picture...'><img src='".$randomImage->getCustomImage(851801800000)."' alt='".$randomImage->getTitle()."' /></a>"?>

See the modifications for getCustomImage( ...

Here is a screenshot with what I obtained until now. I hope you can be able to take control from here.


Here is your package. Remember, I instaled your package in "steerpike" folder.


----------------------------------
Another observation: In ZenPhoto control panel does not appear a new theme named "snews" ... maybe you did something wrong ...

P.S. About not having .htaccess file from beginning... it was there but my Midnight Commander file manager was set to not display hidden files :P
« Last Edit: September 07, 2008, 04:16:16 PM by funlw65 »
Logged

steerpike

  • Newbie
  • *
  • Karma: 13
  • Posts: 38
Re: ZenPhoto 1.2 integration with MU
« Reply #5 on: September 07, 2008, 07:15:32 PM »

That worked!

Thanks Fun!

(I backed up the default zen theme and then renamed the snews theme folder to default and that did the trick)

The only problem is that the images display in one long column floated to the left, instead of just making columns and rows using the available space..

strange...

Anyway, I appreciate your help very much!
« Last Edit: September 07, 2008, 07:18:06 PM by steerpike »
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: ZenPhoto 1.2 integration with MU
« Reply #6 on: September 08, 2008, 04:18:45 PM »

That worked!
The only problem is that the images display in one long column floated to the left, instead of just making columns and rows using the available space..
strange...

You could try adding display: inline; to the CSS style that affects the division containing the images. This may make them display inline rather than one under the other.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
Re: ZenPhoto 1.2 integration with MU
« Reply #7 on: September 09, 2008, 09:00:03 AM »

Oh, ahhh, jesus... I had the exact same flaw just about a day ago or so.... Lemme see, in my dilemma it was the image.php file which resulted in "missfloated" images... However, if edited this might not only be a CSS problem, mine wasn't, but I can't for the life of me remember what it was...

Do you have anything online ?
Logged
My sNews site
"It's only dead fish that goes with the flow... "
Updated, online again - Free designs

steerpike

  • Newbie
  • *
  • Karma: 13
  • Posts: 38
Re: ZenPhoto 1.2 integration with MU
« Reply #8 on: September 09, 2008, 06:08:42 PM »

Do you have anything online ?

Gallery is here:

http://brownconnection.net/gallery

css is here:

http://brownconnection.net/css/ (lightbox.css has nothing to do with anything.. from a different gallery script)

Keyrocks: I tried the display: inline; but that floated the whole container to the left instead  ;D

I have a feeling this might have to do more with the zen css possibly..

Thanks all!

Logged

alks

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 53
Re: ZenPhoto 1.2 integration with MU
« Reply #9 on: August 17, 2010, 06:34:31 PM »

I'm having a few problems with using Zen gallery too. I'm using 1.6MU. I have followed the instructions exactly as in the original tutorial everything appears to have worked i.e Zen gallery works fine but when i boot up my snews on localhost i get the following message.

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\htdocs\mywebsite\snewsMU.php on line 2731

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\htdocs\mywebsite\snewsMU.php on line 370

I've checked everything through multiple times and cant see whats going on? any ideas?

alks
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: ZenPhoto 1.2 integration with MU
« Reply #10 on: August 17, 2010, 08:13:11 PM »

I'm having a few problems with using Zen gallery too. I'm using 1.6MU. I have followed the instructions exactly as in the original tutorial everything appears to have worked i.e Zen gallery works fine but when i boot up my snews on localhost i get the following message.
-    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\htdocs\mywebsite\snewsMU.php on line 2731
-    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\htdocs\mywebsite\snewsMU.php on line 370

I've checked everything through multiple times and cant see whats going on? any ideas?

If your snews installation was working fine before you activated the Z-P package within it, there could be a conflict with whatever is at lines 2731 and 370 in your snewsMU.php file (as noted in your Warning: strings).

Open your snewsMU.php file, find those offending strings, and post them in a code block here so we can look into this further.
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 #11 on: August 18, 2010, 12:21:42 AM »

Yes my snews intsallation was working fine before i attempted to do the zen gallery mod. There must be some sort of conflict like you say. I will revert back to my backed up snews file and re-do the steps again but i'm not sure if it will help. The lines of code refered to in the error meassge are as follows,

Line 370 is on the while loop.
Code: [Select]
// SITE SETTINGS - grab site settings from databas
function s($variable) {
$query = "SELECT value FROM ".db('prefix')."settings WHERE name = '$variable'";
$result = mysql_query($query);
while ($r = mysql_fetch_array($result)) {$value = $r['value'];}
return $value;

line2731 is on the while loop again.
Code: [Select]
// SMART RETRIEVE FUNCTION
function retrieve($column, $table, $field, $value) {
$query = "SELECT $column FROM ".db('prefix')."$table WHERE $field = '$value'";
$result = mysql_query($query);
while ($r = mysql_fetch_array($result)) {$retrieve = $r[$column];}
return $retrieve;
}

I am using version 1.14 of  zen gallery as it was close to the one used in the tutorial.

alks
Logged

Keyrocks

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

For the first one - // SITE SETTINGS, try replacing the function with this one, which iw working fine along ZenPhoto on a client's site:
Code: [Select]
<?php

// SITE SETTINGS - Replacement, performance booster, (invarbrass) Jan.25.08
function s($variable) {
static $site_settings = array();
  
if (array_key_exists($variable$site_settings)){
    
return $site_settings[$variable];
  
} else {
    
$result mysql_query("SELECT value FROM ".db('prefix')."settings WHERE name = '$variable'");
    while (
$r mysql_fetch_array($result)) { $value $r['value']; }
    
$site_settings[$variable] = $value; return $value;
}}

?>


The // SMART RETRIEVE FUNCTION you posted is identical to the one in the same file I have, and it's working alongside ZenPhoto OK too.
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 #13 on: August 18, 2010, 01:34:24 AM »

Thanks for looking in to this, i tried the code but the same result occured, only this time the site template was visable .
i did however get an extra error . Again on the while loop (line 533 in my MU verison)

Code: [Select]
$query = "SELECT * FROM ".db('prefix')."articles WHERE position = 3 ORDER BY id";
$result = mysql_query($query);
while ($r = mysql_fetch_array($result)) {
$title = $r['title'];
$class = ($pageSEF == $r['seftitle'])? ' class="current"' : '';
if ($r['id'] != s('display_page')) {echo '<li><a'.$class.' href="'.db('website').l(


in index.php if i take out the extra bit for zen gallery

Code: [Select]
define('WEBPATH', 'http://localhost/mywebsite/gallery'); require_once("gallery/zp-core/template-functions.php");
then snews loads normally.

I will go through the whole process again tommorow to double check everything.

thanks,

alks
« Last Edit: August 18, 2010, 01:42:24 AM by alks »
Logged

Keyrocks

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

OK... (just back from a short meeting)... I'll check my files some more... to be continued...
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU
Pages: [1] 2 3 4