Montego Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic
Author Message
MisterPat
Newbie
Newbie



Joined: Mar 29, 2009
Posts: 10

PostPosted: Mon Mar 30, 2009 4:21 pm Reply with quote

Is this possible?

Im running RN 2.3 and Gallery2
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1393

PostPosted: Tue Mar 31, 2009 9:29 am Reply with quote

I think it can be done and would be even better/easier if you are not using a separate DB for Gallery2.

We don't really have the time to do this for you, but if you can figure out what G2 tables have the data you want and if the data is in the same RN database, i'd give it a try based upon the other examples within the DT code and if you get stuck, we'll try and help you as best we can.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
MisterPat
Newbie
Newbie



Joined: Mar 29, 2009
Posts: 10

PostPosted: Tue Mar 31, 2009 6:26 pm Reply with quote

I can move the tables into the same database and then edit my Gallery2 config. I found one table in there with the photo name. Its called" g2_FileSystemEntity" And the field is "g_pathComponent" The value for that is the photo name. That would be great to have in the title.

Thanks.

Edit: I just moved the Gallery2 database into the RavenNuke database. The Gallery2 now uses the same user and password as RavenNuke.
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1393

PostPosted: Wed Apr 01, 2009 8:11 am Reply with quote

Actually, for SEO purposes, it would be better to have something more descriptive rather than just file names? I just found an old G2 DB of mine and am wondering what you think of the data in g2_item, specifically g_title?

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
MisterPat
Newbie
Newbie



Joined: Mar 29, 2009
Posts: 10

PostPosted: Wed Apr 01, 2009 10:07 am Reply with quote

Montego, That would be great. This way it would generate titles for albums too.

Thanks for looking into this.
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1393

PostPosted: Fri Apr 03, 2009 8:51 am Reply with quote

MisterPat,

I was only giving you pointers for you to try. I mentioned above that we don't have the time to do it for you. You need to give it a try based upon all the other examples you have in that script to work from. If you get stuck on something specific, we can try to help you, so don't hesitate to post back.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
MisterPat
Newbie
Newbie



Joined: Mar 29, 2009
Posts: 10

PostPosted: Fri Apr 03, 2009 9:39 am Reply with quote

Ok, I will mess around with it. Any pointers where to start? The only php coding I have done was to change variables, true-false,yes-no kind of stuff.
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1393

PostPosted: Fri Apr 03, 2009 6:36 pm Reply with quote

The script which does the Dynamic Titles is here:

includes/dynamic_titles.php

But, if that is all the PHP coding you have done, it may be a bit of a challenge. The trick is going to be finding out what is passed on the URL when you are at the various levels within G2 - i.e., album view, vs. photo view vs. ???? I just can't remember what is on the URL... been a long time.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
MisterPat
Newbie
Newbie



Joined: Mar 29, 2009
Posts: 10

PostPosted: Fri Apr 03, 2009 7:14 pm Reply with quote

Is there a way I can post some code I came up with? I tried before and got a black screen similar to NukeSentenial.
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1393

PostPosted: Fri Apr 03, 2009 7:47 pm Reply with quote

I think I know what is causing that. If you are posting a SQL statement, put a space in between the "S" and "E" like below:

S ELECT * FROM ...

I still haven't gotten around to fixing an issue in my mod_security rules which are causing that problem.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
MisterPat
Newbie
Newbie



Joined: Mar 29, 2009
Posts: 10

PostPosted: Fri Apr 03, 2009 7:49 pm Reply with quote

Ok, here is what is somewhat working, just not fetching the data.

Code:
/*
 * Gallery2
 */
elseif ($name == 'gallery2') {
        $sql = 'S ELECT title FROM g2_item  WHERE g_title id=\'' . intval($id) . '\'';
      $result = $db->sql_query($sql);
      $row = $db->sql_fetchrow($result);

   $newpagetitle = $row['title'] . $dt_sDelim . $sitename . $dt_sDelim . $slogan;
}


BTW, Thanks for the help Montego. I'm actually learning allot here.


Last edited by MisterPat on Fri Apr 03, 2009 11:35 pm; edited 1 time in total 
View user's profile Send private message
MisterPat
Newbie
Newbie



Joined: Mar 29, 2009
Posts: 10

PostPosted: Fri Apr 03, 2009 10:48 pm Reply with quote

Dynamic Titles for Gallery2

1. Move all the data from your Gallery2 database into your Nuke database. Edit your Gallery2 config.php for the new database.

2. Put this code in your /includes/dynamic_titles.php


Code:
/*
 * Gallery2
 */
elseif ($name == 'gallery2') {
        $id = $_GET['g2_itemId'];
        $sql = 'S ELECT g_title FROM g2_Item WHERE g_id=\'' . intval($id) . '\''   ;
        $result = $db->sql_query($sql);
        $row = $db->sql_fetchrow($result);

    $newpagetitle = $row['g_title'] . $dt_sDelim . $sitename;
}


Remove the space in SELECT

EDIT: Here is a url to my galery2 in RavenNuke with this above code in dynamic_titles.php

http://overbrookhospital.net/modules.php?name=gallery2
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1393

PostPosted: Mon Apr 06, 2009 9:01 am Reply with quote

Wow! Excellent work and thank you for sharing this for others to benefit as well.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
MisterPat
Newbie
Newbie



Joined: Mar 29, 2009
Posts: 10

PostPosted: Mon Apr 06, 2009 6:55 pm Reply with quote

Thanks Montego.

Hopefully others will find this useful.

I don't know if it helped, But I also changed Gallery2 database user and password to the same as my RavenNuke.
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1393

PostPosted: Mon Apr 06, 2009 7:14 pm Reply with quote

The real key was having the g2 data in the same database as RavenNuke(tm) in order that the "$db->" calls would work.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

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


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 4 Hours
 
Forums ©
linear-bunch