Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Blocks
Author Message
rubihno
Hangin' Around


Joined: Feb 22, 2008
Posts: 31

PostPosted: Thu Feb 28, 2008 7:58 am Reply with quote

Hi,
i use the galery2 random block.
I put the tables of my galery2 module to another database.
Now i would like to point the block to the other databse, instead of the nuke database.
Here the code of the block:
Code:
<?php

/********************************************************
Latest uploads for PHPnuke integration of Gallery2
http://nukedgallery.net

Author: Sixf00t4 - Only registered users can see links on this board! Get registered or login!
*/

//set how many images to scroll
$limit = 1;


if (eregi("block-G2random.php", $_SERVER['SCRIPT_NAME'])) {
    Header("Location: index.php");
    die();
}

global $prefix, $dbi, $sitename, $user, $cookie, $group_id;
//$content = "<A name= \"scrollingCode\"></A>";
//$content .="<MARQUEE behavior= \"scroll\" align= \"center\" direction= \"up\" height=\"120\" scrollamount= \"0\" scrolldelay= \"25\" onmouseover='this.stop()' onmouseout='this.start()'>";

$result = sql_query("SELECT g_id, g_title FROM g2_Item where g_canContainChildren=0 order by RAND() limit $limit", $dbi);
while(list($g_id, $g_title) = sql_fetch_row($result, $dbi)) {
    $thumb=$g_id+1;
    $url=$g_id-1;
    $content .="<a href='modules.php?name=gallery2&g2_itemId=$url'><center><img src='modules/gallery2/main.php?g2_view=core.DownloadItem&g2_itemId=$thumb&g2_serialNumber=2'><br>$g_title</a></center><br><br>";
}
?>

I am not really familiar with sql, can you tell me what changes i have to do please.
Cheers
 
View user's profile Send private message
Guardian2003
Site Admin


Joined: Aug 28, 2003
Posts: 6792
Location: Ha Noi, Viet Nam

PostPosted: Thu Feb 28, 2008 9:35 am Reply with quote

Nuke uses the $dbi variable to hold the database connection information so you'll need to create a new set of connection data to enable the block to connect to the database, then you would need to alter the tables names to suit the ones you are using.
Sorry I cannot help you more but I don't really have the time to write all the code for it.
 
View user's profile Send private message Send e-mail
fkelly
Former Moderator in Good Standing


Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY

PostPosted: Thu Feb 28, 2008 10:32 am Reply with quote

I'm not sure where you got that block. The one I am using on my site (webmhcc.org) is entirely different and comes from the Gallery2 Integration site. The file name is block_G2_Imageblock. You might want to check for an update.
 
View user's profile Send private message Visit poster's website
rubihno
PostPosted: Thu Feb 28, 2008 11:59 am Reply with quote

I wanted to check your block an get blocked from sentinel Sad
 
nimis
Hangin' Around


Joined: Dec 13, 2007
Posts: 37
Location: New York, Bklyn

PostPosted: Thu Mar 06, 2008 6:39 am Reply with quote

fkelly wrote:
I'm not sure where you got that block. The one I am using on my site (webmhcc.org) is entirely different and comes from the Gallery2 Integration site. The file name is block_G2_Imageblock. You might want to check for an update.


fkelly I was interested in checking out the random block that your running on your site "web.hcc.org".
Pretty hard when I get NukeSentinel's "You have been blocked from entering this site." Sad
 
View user's profile Send private message
fkelly
PostPosted: Sat Mar 08, 2008 4:31 pm Reply with quote

Sorry, traveling. Post your IP here or PM it to me and I will look into the situation but probably not until Monday. I have many non-USA IP's blocked since my site is for bicycle riders in Upstate NY. I'll be happy to make exceptions.

The G2_Imageblock I mentioned works great, I must say. There are several customization options in the code that you'll want to look at. But basically, on each page load, a random picture from your Gallery loads in a left side block and people can click it to go to the underlying picture and album.
 
fkelly
PostPosted: Sun Mar 09, 2008 1:00 pm Reply with quote

Just did some looking around. No guarantees, but I think you need to go to

[url]http.nukedgallery.net[/url]

and get the latest integration pack (.063 from March of 2007). I just have the prior one to that on my site. Then look in the blocks directory and there should be the g2_imageblock that I referenced. You may need to register with that site to download anything.
 
rubihno
PostPosted: Sun Mar 09, 2008 8:49 pm Reply with quote

I have this one, i always get the message to activate the block module in the galerry, just i dont have a setting where i can activate this...
 
nimis
PostPosted: Mon Mar 10, 2008 6:50 am Reply with quote

fkelly wrote:
Sorry, traveling. Post your IP here or PM it to me and I will look into the situation but probably not until Monday. I have many non-USA IP's blocked since my site is for bicycle riders in Upstate NY. I'll be happy to make exceptions.

The G2_Imageblock I mentioned works great, I must say. There are several customization options in the code that you'll want to look at. But basically, on each page load, a random picture from your Gallery loads in a left side block and people can click it to go to the underlying picture and album.


Hi fkelly.. After intense reading and testing of Gallery Video 2.24 (which does the job) Ive discovered that my webhost is running the in safe mode so I wont be able to use it.
Appreciate your help and willing to add my ip to you ok list but we've still got about 7 months left with the present host and will be looking for a better one when our contract runs out.
I found HTTP Video Stream V4.53 and am running that at the moment.

Thanks again for now..
 
fkelly
PostPosted: Mon Mar 10, 2008 9:41 am Reply with quote

Rubinho: if you have the G2_imageblock.php file in your /blocks directory then when you go into the Admin program ... blocks ... you should have it listed in the filenames area and be able to activate it. The blocks admin program looks thru that directory for block files so if it's there it should show.

Nimis, independent of my exalted moderator status, I run a web site. I too was using a brain dead host until I switched over to Raven. As you know from working with Gallery, it is a HUGE program ... I'd estimate that I spend as much time on that as the rest of my site combined ... but I'd highly recommend Raven's hosting for running it. Last year he switched over to something called PHPsuexec (I think I spelled that right) and it really helps eliminate many permissions problems that plague Gallery on other shared hosts. Raven will also work with you if you run into resource issues whereas many other shared hosts will tell you to go pound salt.
 
rubihno
PostPosted: Mon Mar 10, 2008 10:04 am Reply with quote

Thanks, i have my own shared server and a long contract....
I am sure Ravens hosting is great.
Cheers
 
nimis
PostPosted: Mon Mar 10, 2008 1:46 pm Reply with quote

fkelly wrote:

Nimis, independent of my exalted moderator status, I run a web site. I too was using a brain dead host until I switched over to Raven. As you know from working with Gallery, it is a HUGE program ... I'd estimate that I spend as much time on that as the rest of my site combined ... but I'd highly recommend Raven's hosting for running it. Last year he switched over to something called PHPsuexec (I think I spelled that right) and it really helps eliminate many permissions problems that plague Gallery on other shared hosts. Raven will also work with you if you run into resource issues whereas many other shared hosts will tell you to go pound salt.


As I am and will be using Ravens Scripts, your tip on his hosting is very interesting. I'll have to place en enquiery to them.

As for pounding salt, that was very well put. What every happened to customer service.

Again.. truely appreciate the correspondence and help Ive received so far..

Nimis
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Blocks

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©