Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 3 4 [5] 6

Author Topic: Integrating Zenphoto in sNews.  (Read 32174 times)

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
Integrating Zenphoto in sNews.
« Reply #60 on: June 24, 2007, 10:32:38 am »

mdmiko... welcome here, and hope you'll like it...

Both sNews and ZenPhoto use a function called strip(). And in order to make the 1.6 "swollow" our integration of Zenphoto we need to change the occurances of strip inside sNews.php. so we do it like this:

Find these occurances inside the snews.php:
Quote
1. .strip($title).
2. .strip($text).
3. function strip($text)
And change them into eg:
Quote
1. .snews_strip($title).
2. .snews_strip($text).
3. function snews_strip($text)
And your all done. Now it should work...
Logged
"It's only dead fish that goes with the flow... "
Updated

mdmiko

  • Newbie
  • *
  • Karma: 0
  • Posts: 5
Integrating Zenphoto in sNews.
« Reply #61 on: June 24, 2007, 01:17:01 pm »

hi, all this are wonderfull.
i ported 3 websites from other cms to sNews.
power, light weight, standard copiliant and simple to admn... there isn't better than this :)
Logged

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
Integrating Zenphoto in sNews.
« Reply #62 on: June 24, 2007, 08:05:08 pm »

Sooo, I guess you got it to work then ;)
Logged
"It's only dead fish that goes with the flow... "
Updated

Zucye

  • Sr. Member
  • ****
  • Karma: 5
  • Posts: 347
    • Simplemente una Mujer
Integrating Zenphoto in sNews.
« Reply #63 on: June 29, 2007, 07:39:30 am »

Yes, it Works  :D
Logged
We can always learn from our failures, not so much from obvious success - C. Robinson (W. Disney). :)

centered

  • Guest
Re: Integrating Zenphoto in sNews.
« Reply #64 on: August 22, 2007, 06:27:00 pm »

Quick question, not sure if anyone has done it or can be done.. Is it possible to include zenphoto's php calls in snews for instance:
session start(); include snews.php; include gallery/zp-core.php, etc

Then somewhere, maybe a sidebar maybe use:
<?php zp_latest_pictures_or_something(); ?>

I think some may get what I am hinting at....
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: Integrating Zenphoto in sNews.
« Reply #65 on: August 22, 2007, 06:42:57 pm »

@ Centered...
I think I tried that approach when I first started trying to use ZenPhoto with sNews 14 and it did not work. There were some conflicts between the two different "engines" when querying their respective databases (if I remember correctly). I wish the two could run together as one... I think they were meant for each other.  :)
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

centered

  • Guest
Re: Integrating Zenphoto in sNews.
« Reply #66 on: August 22, 2007, 07:59:32 pm »

There goes my idea for showing latest photos in the sidebar.... sigh..

Thanks Keys
Logged

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: Integrating Zenphoto in sNews.
« Reply #67 on: August 22, 2007, 08:07:58 pm »

please do, please do ;)
Logged
"It's only dead fish that goes with the flow... "
Updated

centered

  • Guest
Re: Integrating Zenphoto in sNews.
« Reply #68 on: August 22, 2007, 09:45:01 pm »

Well checking the Zenphoto Trac, there is a function already (untested by me of course) which lead me to the question I had:
http://www.zenphoto.org/trac/wiki/ZenphotoHacks#LatestImagesCustomFunction
Logged

centered

  • Guest
Re: Integrating Zenphoto in sNews.
« Reply #69 on: August 22, 2007, 10:35:16 pm »

Thanks Baker, I may take a look at it tonight myself on a fresh install of each but being the newb I am, I may not get far lol!
Logged

centered

  • Guest
Re: Integrating Zenphoto in sNews.
« Reply #70 on: August 23, 2007, 12:21:36 am »

Works for me!
*EDIT* well sort of.... only works for the gallery page... duh

*EDIT2* Well I sort of got it working with:
<?php session_start(); include('snews.php'); require_once("gallery/zen/template-functions.php"); ?>
Problem?
Images are not getting the correct path:
http://localhost/16/index.php?album=wallpapers&image=constrTETRIS_by_polaus.jpg
Which should be:
http://localhost/16/gallery/index.php?album=wallpapers&image=constrTETRIS_by_polaus.jpg



Problem.. I can't use zen's htaccess....
« Last Edit: August 23, 2007, 08:31:09 am by centered effect »
Logged

Zucye

  • Sr. Member
  • ****
  • Karma: 5
  • Posts: 347
    • Simplemente una Mujer
Re: Integrating Zenphoto in sNews.
« Reply #71 on: August 23, 2007, 03:59:53 am »

There goes my idea for showing latest photos in the sidebar.... sigh..

I was looking to do something similar sometime ago.  I found the following treat in the zenphoto forum, but the members there are not as friendly and nice as you guys so I didn't accomplish anything :(.  Hope you guys can!

http://www.zenphoto.org/support/topic.php?id=7&page=2
Logged
We can always learn from our failures, not so much from obvious success - C. Robinson (W. Disney). :)

centered

  • Guest
Re: Integrating Zenphoto in sNews.
« Reply #72 on: August 23, 2007, 07:54:22 am »

Odd zucye, since a mod is in the Trac and a demo is shown here: http://albums.sbillard.org/

The code for that link is easily downloadable (http://www.zenphoto.org/trac/attachment/wiki/ZenphotoThemes/Effervescence_Simpleviewer.zip) but untested by me:

In functions:
Code: [Select]
// Get Random Images
function getRandomImages() {
$result = query_single_row('SELECT '.prefix("images").'.filename,'.prefix("images").'.title, '.prefix("albums").'.folder FROM '.prefix("images").' INNER JOIN '.prefix("albums").' ON '.prefix("images").'.albumid = '.prefix("albums").'.id ORDER BY RAND() LIMIT 1');
$image = new Image(new Album(new Gallery(), $result['folder']), $result['filename']);
return $image;
}
function getURL($image) {
if (zp_conf('mod_rewrite'))
{
return WEBPATH . "/" . pathurlencode($image->getAlbumName()) . "/" . urlencode($image->name);
}
else
{
return WEBPATH . "/index.php?album=" . pathurlencode($image->getAlbumName()) . "&image=" . urlencode($image->name);
}
}

In index.php:
Code: [Select]
<?php $randomImage getRandomImages(); $randomImageURL getURL($randomImage); print "<a href='".getURL($randomImage)."' title='Random Picture...'><img src='".$randomImage->getCustomImage(1000620180620180300300)."' alt='".$randomImage->getTitle()."' /></a>"?>


*edit* the functions above does work!
The odd numbers in getCustomImage outputs:
i.php?a=wallpapers&i=Clown_Fish.jpg&s=1000&w=620&h=180&cw=620&ch=180&cx=300&cy=300'

i just changed the first number 1000 because s=1000 in the output, I assume s=size.
Adding it as 85 works as a thumbnail.

EDIT - in /zen/i.php gives me this:
 *   s  - size (logical): Based on config, makes an image of "size s."
 *   h  - height (explicit): Image is always h pixels high, w is calculated.
 *   w  - width (explicit): Image is always w pixels wide, h is calculated.
 *   cw - crop width: crops the image to cw pixels wide.
 *   ch - crop height: crops the image to ch pixels high.
 *   cx - crop x position: the x (horizontal) position of the crop area.
 *   cy - crop y position: the y (vertical) position of the crop area.
 *   q  - JPEG quality (1-100): sets the quality of the resulting image.


NOW.. getting it into sNews properly.... The images are not showing for me
« Last Edit: August 23, 2007, 08:55:05 am by centered effect »
Logged

centered

  • Guest
Re: Integrating Zenphoto in sNews.
« Reply #73 on: August 23, 2007, 09:10:33 am »

Ok NOW I got it working..

damn WEBPATH
<?php session_start(); include('snews.php'); define('WEBPATH', 'gallery/'); require_once("gallery/zen/template-functions.php"); ?>

Ok to the five people who downloaded the files before, please redownload the new one, sorry!

Default sNews (with a link to the gallery in Display pages) and a default zenphoto with added updated images and random image functions, including default sNews theme
http://www.apadmedia.com/publicfolder/index.php?action=downloadfile&filename=sNews16-zenphoto.zip&directory=sNews%20Mods&
« Last Edit: August 23, 2007, 09:12:53 am by centered effect »
Logged

centered

  • Guest
Re: Integrating Zenphoto in sNews.
« Reply #74 on: August 23, 2007, 09:20:02 am »

To anyone downloading this, can you please comment to let me know it it works for you? If it does, I want to post this in the mod section of 1.6

You will still need to install the sNews db, edit snews.php, edit zp-config (default user/pass is test/test) and htaccess (if you use it) and run the gallery/zen/setup.php

BTW its a 3.3MB file, I inlcuded some pictures to help start and test the package

Sql statement
Code: [Select]
-- phpMyAdmin SQL Dump
-- version 2.8.1-Debian-1~dapper1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Aug 23, 2007 at 03:31 AM
-- Server version: 5.0.22
-- PHP Version: 5.1.2
--
-- Database: `16`
--

-- --------------------------------------------------------

--
-- Table structure for table `articles`
--

CREATE TABLE `articles` (
  `id` int(11) NOT NULL auto_increment,
  `title` varchar(100) default NULL,
  `seftitle` varchar(100) default NULL,
  `text` longtext,
  `date` datetime default NULL,
  `category` int(8) NOT NULL default '0',
  `position` int(6) default NULL,
  `displaytitle` char(3) NOT NULL default 'YES',
  `displayinfo` char(3) NOT NULL default 'YES',
  `commentable` varchar(5) NOT NULL default '',
  `published` int(3) NOT NULL default '1',
  `description_meta` varchar(255) default NULL,
  `keywords_meta` varchar(255) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `articles`
--


-- --------------------------------------------------------

--
-- Table structure for table `categories`
--

CREATE TABLE `categories` (
  `id` int(8) NOT NULL auto_increment,
  `name` varchar(100) NOT NULL,
  `seftitle` varchar(100) NOT NULL,
  `description` varchar(255) NOT NULL,
  `published` varchar(4) NOT NULL default 'YES',
  `catorder` smallint(6) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `categories`
--


-- --------------------------------------------------------

--
-- Table structure for table `comments`
--

CREATE TABLE `comments` (
  `id` int(11) NOT NULL auto_increment,
  `articleid` int(11) default '0',
  `name` varchar(50) default NULL,
  `url` varchar(100) NOT NULL,
  `comment` text,
  `time` datetime NOT NULL default '0000-00-00 00:00:00',
  `approved` varchar(5) NOT NULL default 'True',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `comments`
--


-- --------------------------------------------------------

--
-- Table structure for table `settings`
--

CREATE TABLE `settings` (
  `id` int(8) NOT NULL auto_increment,
  `name` varchar(20) NOT NULL,
  `value` varchar(60) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=24 ;

--
-- Dumping data for table `settings`
--

INSERT INTO `settings` (`id`, `name`, `value`) VALUES (1, 'website_title', 'sNews 1.6'),
(2, 'home_sef', 'home'),
(3, 'website_description', 'Single File CMS'),
(4, 'website_keywords', 'sNews, cms'),
(5, 'website_email', 'park.jason@gmail.com'),
(6, 'contact_subject', 'Contact Form'),
(7, 'language', 'EN'),
(8, 'charset', 'UTF-8'),
(9, 'date_format', 'F j,Y'),
(10, 'article_limit', '5'),
(11, 'rss_limit', '5'),
(12, 'display_page', '0'),
(13, 'display_new_on_home', 'on'),
(14, 'display_pagination', ''),
(15, 'num_categories', 'on'),
(16, 'approve_comments', 'on'),
(17, 'comments_order', 'ASC'),
(18, 'comment_limit', '30'),
(19, 'word_filter_enable', ''),
(20, 'word_filter_file', ''),
(21, 'word_filter_change', ''),
(22, 'username', '098f6bcd4621d373cade4e832627b4f6'),
(23, 'password', '098f6bcd4621d373cade4e832627b4f6');

-- --------------------------------------------------------

--
-- Table structure for table `zp_albums`
--

CREATE TABLE `zp_albums` (
  `id` int(11) unsigned NOT NULL auto_increment,
  `parentid` int(11) unsigned default NULL,
  `folder` varchar(255) NOT NULL default '',
  `title` varchar(255) NOT NULL default '',
  `desc` text,
  `date` datetime default NULL,
  `place` varchar(255) default NULL,
  `show` int(1) unsigned NOT NULL default '1',
  `thumb` varchar(255) default NULL,
  `sort_type` varchar(20) default NULL,
  `sort_order` int(11) unsigned default NULL,
  PRIMARY KEY  (`id`),
  KEY `folder` (`folder`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

--
-- Dumping data for table `zp_albums`
--

INSERT INTO `zp_albums` (`id`, `parentid`, `folder`, `title`, `desc`, `date`, `place`, `show`, `thumb`, `sort_type`, `sort_order`) VALUES (1, NULL, 'wallpapers', 'wallpapers', 'A collection of wallpapers on my computer', NULL, '', 1, '00954_lakeofgruyere_1680x1050.jpg', 'Filename', NULL);

-- --------------------------------------------------------

--
-- Table structure for table `zp_comments`
--

CREATE TABLE `zp_comments` (
  `id` int(11) unsigned NOT NULL auto_increment,
  `imageid` int(11) unsigned NOT NULL default '0',
  `name` varchar(255) NOT NULL default '',
  `email` varchar(255) NOT NULL default '',
  `website` varchar(255) default NULL,
  `date` datetime default NULL,
  `comment` text NOT NULL,
  `inmoderation` int(1) unsigned NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `imageid` (`imageid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `zp_comments`
--


-- --------------------------------------------------------

--
-- Table structure for table `zp_images`
--

CREATE TABLE `zp_images` (
  `id` int(11) unsigned NOT NULL auto_increment,
  `albumid` int(11) unsigned NOT NULL default '0',
  `filename` varchar(255) NOT NULL default '',
  `title` varchar(255) default NULL,
  `desc` text,
  `commentson` int(1) NOT NULL default '1',
  `show` int(1) NOT NULL default '1',
  `sort_order` int(11) unsigned default NULL,
  `height` int(10) unsigned default NULL,
  `width` int(10) unsigned default NULL,
  PRIMARY KEY  (`id`),
  KEY `filename` (`filename`,`albumid`),
  KEY `albumid` (`albumid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=10 ;

--
-- Dumping data for table `zp_images`
--

INSERT INTO `zp_images` (`id`, `albumid`, `filename`, `title`, `desc`, `commentson`, `show`, `sort_order`, `height`, `width`) VALUES (1, 1, '00954_lakeofgruyere_1680x1050.jpg', '00954_lakeofgruyere_1680x1050', 'Photo taken at a lake, photshopped of course', 1, 1, NULL, NULL, NULL),
(2, 1, '8677_Wallpaper_by_The_Definition.jpg', '8677_Wallpaper_by_The_Definition', 'trippy things going on here', 1, 1, NULL, NULL, NULL),
(3, 1, 'ascend_dawn2_wide.jpg', 'ascend_dawn2_wide', 'my current desktop, minimalistic and nice', 1, 1, NULL, NULL, NULL),
(4, 1, 'Clown_Fish.jpg', 'Clown_Fish', 'The iphone wallpaper, also comes with OSX', 1, 1, NULL, NULL, NULL),
(5, 1, 'constrTETRIS_by_polaus.jpg', 'constrTETRIS_by_polaus', 'Awesome vector work here, not good for my widescreen though', 1, 1, NULL, NULL, NULL);

*BUG FIX* - snews index.php should be:
<?php session_start(); include('snews.php'); define('WEBPATH', 'gallery'); require_once("gallery/zen/template-functions.php"); ?>

gallery WEBPATH should not have the '/'. URLs will work otherwise on my machine but for clarity and proper urls, then get rid of the slash

FIX - Add to function administration()
change
Code: [Select]
echo '<p><a href="files/" title="'.l('files').'">'.l('files').'</a></p></fieldset>';to
Code: [Select]
echo '<p><a href="files/" title="'.l('files').'">'.l('files').'</a></p>';
echo '<p><a href="gallery/zen/admin.php" title="ZenPhoto Admin">Gallery Admin</a></p></fieldset>';

Just waiting for Baker to add the admin logging to zenphoto a page or so back
« Last Edit: August 23, 2007, 10:14:53 am by centered effect »
Logged
Pages: 1 ... 3 4 [5] 6