| Author |
Message |
MisterPat
Newbie


Joined: Mar 29, 2009
Posts: 10
|
Posted:
Mon Mar 30, 2009 4:21 pm |
|
Is this possible?
Im running RN 2.3 and Gallery2 |
| |
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 1360
|
Posted:
Tue Mar 31, 2009 9:29 am |
|
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 |
|
|
 |
MisterPat
Newbie


Joined: Mar 29, 2009
Posts: 10
|
Posted:
Tue Mar 31, 2009 6:26 pm |
|
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. |
| |
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 1360
|
Posted:
Wed Apr 01, 2009 8:11 am |
|
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 |
|
|
 |
MisterPat
Newbie


Joined: Mar 29, 2009
Posts: 10
|
Posted:
Wed Apr 01, 2009 10:07 am |
|
Montego, That would be great. This way it would generate titles for albums too.
Thanks for looking into this. |
| |
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 1360
|
Posted:
Fri Apr 03, 2009 8:51 am |
|
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 |
|
|
 |
MisterPat
Newbie


Joined: Mar 29, 2009
Posts: 10
|
Posted:
Fri Apr 03, 2009 9:39 am |
|
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. |
| |
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 1360
|
Posted:
Fri Apr 03, 2009 6:36 pm |
|
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 |
|
|
 |
MisterPat
Newbie


Joined: Mar 29, 2009
Posts: 10
|
Posted:
Fri Apr 03, 2009 7:14 pm |
|
Is there a way I can post some code I came up with? I tried before and got a black screen similar to NukeSentenial. |
| |
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 1360
|
Posted:
Fri Apr 03, 2009 7:47 pm |
|
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 |
|
|
 |
MisterPat
Newbie


Joined: Mar 29, 2009
Posts: 10
|
Posted:
Fri Apr 03, 2009 7:49 pm |
|
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 |
|
|
 |
MisterPat
Newbie


Joined: Mar 29, 2009
Posts: 10
|
Posted:
Fri Apr 03, 2009 10:48 pm |
|
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 |
| |
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 1360
|
Posted:
Mon Apr 06, 2009 9:01 am |
|
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 |
|
|
 |
MisterPat
Newbie


Joined: Mar 29, 2009
Posts: 10
|
Posted:
Mon Apr 06, 2009 6:55 pm |
|
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. |
| |
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 1360
|
Posted:
Mon Apr 06, 2009 7:14 pm |
|
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 |
|
|
 |
|
|