I've tried getting help from Calic0cat, the creator of the block for efiction to use cpmFetch. She couldn't figure out this problem I'm having and suggested I try posting over here and see if anyone could help out.
VersionsEfiction v 3.2.1
Coppermine v 1.4.1
CpmFetch v 1.6.4
PHP v 5.2.1
MySQL v 4.1.21
URL/Installation Directories...http://www.themasque.net/efiction/
http://www.themasque.net/coppermine/
http://www.themasque.net/cpmfetch/
What I've Done...-Installed cpmfetch okay, the test page displayed the two images I have in the coppermine gallery.
-Edited the cpgrecent.php file for the eFiction block to have the correct urls and uploaded it to the server.
<?php
require_once "../cpmfetch/cpmfetch.php";
$objCpm = new cpm("/coppermine");
$objCpm->cpm_setReturnType('html');
$options = array( 'subtitle' => '%t' , 'tablestyle' => 'ccontent' );
$content = $objCpm->cpm_viewLastAddedMedia(3,1,$options);
?>
-Initialized the block in the admin panel.
-Go back to the main page
-Receive error message.
QuoteA fatal MySQL error was encountered.
Query: SELECT message_text FROM fanfiction_messages WHERE message_name = 'welcome'
Error: (1146) Table 'bgmasque_coppermine.fanfiction_messages' doesn't exist
- I tried Calic0cat's suggestion of adding "$objCpm->cpm_close();" to the code just after the "$content" line and get this error...
QuoteWarning: mysql_query() [function.mysql-query]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/bgmasque/public_html/efiction/includes/dbfunctions.php on line 18
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/bgmasque/public_html/efiction/includes/dbfunctions.php on line 18
A fatal MySQL error was encountered.
Query: SELECT message_text FROM fanfiction_messages WHERE message_name = 'welcome'
Error: (2002) Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Hopefully thats enough details to get someone's brain ticking.
Thanks in advance.
(Theres no modify button on these forums?)
Quote from: Calic0cat
I'm leaning towards the php 5 being the problem, however, as jacci (the other poster with the same problem) was also running php 5.x. Definitely a point worth mentioning if you post over on the cpmfetch forum.
Quote from: lonebard on March 24, 2007, 04:46:15 PM
(Theres no modify button on these forums?)
Well, I have no idea about Effliction... I've never heard of it.
I would not recommend the close statement - technically you don't need it as PHP will clean up after you. The older "stable" version of cpmfetch (we are on the cusp of a new age with cpmfetch 2.0) had a nasty habit of trashing your database connection if it re-used it.
I would not suspect problems with PHP5 and cpmfetch. Not sure what the add on there does to it.
If you want to post links, I will check and see what efflication does for php blocks and what calic0cats module does.
Otherwise, I only have the obvious question... does the table it says does not exist really exist ??
http://www.efiction.org/
calic0cats module - http://efiction.org/forums/index.php?topic=4487.0
As for your obvious question. The table exists in the database for eFiction, but I think that calic0cats' idea is that somehow cpmfetch isn't looking in the eFiction database it's looking for it in the coppermine database?
Hope that makes sense.
Quote from: vuud on March 24, 2007, 10:53:04 PM
I would not recommend the close statement - technically you don't need it as PHP will clean up after you. The older "stable" version of cpmfetch (we are on the cusp of a new age with cpmfetch 2.0) had a nasty habit of trashing your database connection if it re-used it.
I suggested the close in the faint hope that eFiction would be smart enough to open a fresh connection. Unfortunately, it wasn't. :P
Quote
I would not suspect problems with PHP5 and cpmfetch. Not sure what the add on there does to it.
If you want to post links, I will check and see what efflication does for php blocks and what calic0cats module does.
In order to see a working version of cpmfetch in eFiction blocks, you can check my own site at http://www.calic0cat.net - that one has efiction and Coppermine sharing a database, and cpmfetch and Coppermine are both in (separate) subdirectories of the eFiction directory. I also have it working on two test sites, one at http://test.calic0cat.net/efiction/ with a shared database but with eFiction and Coppermine in side-by-side directories, and one at http://test2.calic0cat.net/efiction/ with eFiction and Coppermine on separate databases and in side-by-side directories. It works just fine in all three cases. All working examples are eFiction 3.2 (both test sites) or 3.2.1 (live site only) with Coppermine Gallery 1.4.10 and cpmfetch 1.6.4. The MySQL version is 4.1.16 and PHP is 4.4.2 (with "extra web security"). All sites are (normally) bridged; however, I have disabled bridging on the test2 site in order to eliminate that as a source of the differing behaviour. Disabling the bridging made no difference; the cpmfetch blocks still work fine in eFiction.
*Edit* Important additional note: I've switched the http://test2.calic0cat.net/efiction site over to PHP 5.2.1 without encountering any errors, which shoots my PHP 5 theory all to heck.
Quote
Otherwise, I only have the obvious question... does the table it says does not exist really exist ??
It looks to me as if, in lonebard's case (and that of another eFiction user experiencing the same issue), eFiction is looking in the Coppermine database instead of in the eFiction database. Why this issue crops up for them when it works fine for me, I don't know and I've run out of ideas to try.
Quote from: Calic0cat on March 25, 2007, 06:43:17 AM
I suggested the close in the faint hope that eFiction would be smart enough to open a fresh connection. Unfortunately, it wasn't. :P
In order to see a working version of cpmfetch in eFiction blocks, you can check my own site at http://www.calic0cat.net - that one has efiction and Coppermine sharing a database, and cpmfetch and Coppermine are both in (separate) subdirectories of the eFiction directory. I also have it working on two test sites, one at http://test.calic0cat.net/efiction/ with a shared database but with eFiction and Coppermine in side-by-side directories, and one at http://test2.calic0cat.net/efiction/ with eFiction and Coppermine on separate databases and in side-by-side directories. It works just fine in all three cases. All working examples are eFiction 3.2 (both test sites) or 3.2.1 (live site only) with Coppermine Gallery 1.4.10 and cpmfetch 1.6.4. The MySQL version is 4.1.16 and PHP is 4.4.2 (with "extra web security"). All sites are (normally) bridged; however, I have disabled bridging on the test2 site in order to eliminate that as a source of the differing behaviour. Disabling the bridging made no difference; the cpmfetch blocks still work fine in eFiction.
*Edit* Important additional note: I've switched the http://test2.calic0cat.net/efiction site over to PHP 5.2.1 without encountering any errors, which shoots my PHP 5 theory all to heck.
It looks to me as if, in lonebard's case (and that of another eFiction user experiencing the same issue), eFiction is looking in the Coppermine database instead of in the eFiction database. Why this issue crops up for them when it works fine for me, I don't know and I've run out of ideas to try.
Hallo!
Thanks for making extending CpmFetch into another realm. I really intended cpmFetch to be used this way - a resource for people to extend.
More so now... See my developers page http://cpmfetch.fistfullofcode.com/developers/index.php if you are interested. I am also going to produce documentation specifically for developers.
(The site is not quite done yet)
Sometime... ;P
Anyway, its late here - I will mull this over tomorrow and see if I can come up with anything.
Oh - one of the first things may be to move to a dev version... The code is much newer and it will be stable in the immediate future. I believe I recoded the dbconnect stuff - so it should play nicer... but avoiding the close should have fixed that...
Hmmmmm
I'll try running a dev version but I'm not sure if the eFiction block that calicocat has created will support it.
Installation of 1.9.12 went fine. I used the code displayed in the CpmFetch installer to replace the code from CalicoCat's efiction block. (Editing the URL to be correct obviously).
The funny thing is, it gives a very similar error to the previous one...
QuoteWarning: mysql_query() [function.mysql-query]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/bgmasque/public_html/efiction/includes/dbfunctions.php on line 18
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/bgmasque/public_html/efiction/includes/dbfunctions.php on line 18
A fatal MySQL error was encountered.
Query: SELECT message_text FROM fanfiction_messages WHERE message_name = 'welcome'
Error: (2002) Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
BUT it displays the two images... just nothing else.
http://www.themasque.net/efiction/
I also noticed that the code given by the installer included the " $objCpm->cpm_close();" line. I removed it and now I don't get the same error, but something similar.
QuoteA fatal MySQL error was encountered.
Query: SELECT message_text FROM fanfiction_messages WHERE message_name = 'welcome'
Error: (1146) Table 'bgmasque_coppermine.fanfiction_messages' doesn't exist
Seems to me Calico's idea was correct. Its looking in the coppermine database for the Efiction data.
Quote from: lonebard on March 27, 2007, 07:01:43 PM
I also noticed that the code given by the installer included the " $objCpm->cpm_close();" line. I removed it and now I don't get the same error, but something similar.
Seems to me Calico's idea was correct. Its looking in the coppermine database for the Efiction data.
Yes, the installer is for basic use... covers %90 of the people. So removing the close was good.
Okay, so for some reason cpmfetch is hyjacking the mysql connection?
Weird, it should not do that.
Without the cpmfetch stuff, I assume all runs well?
Yep, as soon as i disabled cpmFetch code block the eFiction mainpage comes up fine.
Quote from: lonebard on March 27, 2007, 07:49:16 PM
Yep, as soon as i disabled cpmFetch code block the eFiction mainpage comes up fine.
I am doing this from memory, so hope for the best.
In the cpmfetch_config.php file that the install generated, there should be an option in there named:
// $config_overrides['cfUseExistingDBConnection'] = 'false';
Make sure it says false. If it says true, change it look like this
$config_overrides['cfUseExistingDBConnection'] = 'true';
Let me know
Hmm, I removed the slashes, changed it to true, same error. No changes at all that I can see.
Quote from: lonebard on March 27, 2007, 10:57:20 PM
Hmm, I removed the slashes, changed it to true, same error. No changes at all that I can see.
Sorry, the line to change it to should be:
$config_overrides['cfUseExistingDBConnection'] = 'false';
If the commented out version was false, it will not help as that is what the install thinks your site needs.
I did some digging on this, but nothing neat yet.
Ah ok, sorry I missunderstood that.
Changed it to
$config_overrides['cfUseExistingDBConnection'] = 'false';
Still no change.
Ah, actually there is a change i guess the page was just cached at the time.
Now nothing comes up, I just get a pure white page.
http://www.themasque.net/efiction/
Ok maybe the host had a brain fart for the few minutes.
no change.
(I hope double posting isnt against the rules here)
Quote from: lonebard on March 27, 2007, 11:59:45 PM
Ok maybe the host had a brain fart for the few minutes.
no change.
(I hope double posting isnt against the rules here)
I have no idea... I probably have to look at efiction some more. Regrettably Command and Conquer just came out today, so it probably will not be tonight. :D
ok.
...Thanks I guess.
Quote from: lonebard on March 28, 2007, 03:38:45 PM
ok.
...Thanks I guess.
I think you may be screwed... Actually maybe not
Here is the problem and I am not sure why it happens to you, but not other people.
The version of eFiction I downloaded (3.2.1) is written in such a way that it does not care about what database it uses specifically. It makes a faulty assumption that the last DB opened is the one that it wants to use. So when you start efiction, then start cpmfetch, then do some more with efiction it goes kaplooey. Splat.
Proper fix: The proper fix for this is that efiction rewrite the database code in there to care about what database link it is. CpmFetch tracks its own connection, but eFiction just uses the last one opened. Probably not that bad for someone to fix, since they seem to have kept all the database work in one file (I did not verify it, but seems that way).
Improper fixes:
- Install CPG into the same database as eFiction, or vice-e-versa
- Start CpmFetch and make a call for an image before eFiction creates its dbconnection
- Fix the DB Code in eFiction yourself.
I know these are not the answers you are looking for. I am happy to say that this is not a CpmFetch problem, but an unforseen condition in the efiction program (they never expected another db connection to be made).
Does that help?
Supporting docs for when they say its not an efiction problem:
http://us2.php.net/mysql_query
Quotelink_identifier
The MySQL connection. If the link identifier is not specified, the last link opened by mysql_connect() is assumed. If no such link is found, it will try to create one as if mysql_connect() was called with no arguments. If by chance no connection is found or established, an E_WARNING level warning is generated.
Quote from: Calic0cat on March 25, 2007, 06:43:17 AM
I suggested the close in the faint hope that eFiction would be smart enough to open a fresh connection. Unfortunately, it wasn't. :P
In order to see a working version of cpmfetch in eFiction blocks, you can check my own site at http://www.calic0cat.net - that one has efiction and Coppermine sharing a database, and cpmfetch and Coppermine are both in (separate) subdirectories of the eFiction directory. I also have it working on two test sites, one at http://test.calic0cat.net/efiction/ with a shared database but with eFiction and Coppermine in side-by-side directories, and one at http://test2.calic0cat.net/efiction/ with eFiction and Coppermine on separate databases and in side-by-side directories. It works just fine in all three cases. All working examples are eFiction 3.2 (both test sites) or 3.2.1 (live site only) with Coppermine Gallery 1.4.10 and cpmfetch 1.6.4. The MySQL version is 4.1.16 and PHP is 4.4.2 (with "extra web security"). All sites are (normally) bridged; however, I have disabled bridging on the test2 site in order to eliminate that as a source of the differing behaviour. Disabling the bridging made no difference; the cpmfetch blocks still work fine in eFiction.
*Edit* Important additional note: I've switched the http://test2.calic0cat.net/efiction site over to PHP 5.2.1 without encountering any errors, which shoots my PHP 5 theory all to heck.
It looks to me as if, in lonebard's case (and that of another eFiction user experiencing the same issue), eFiction is looking in the Coppermine database instead of in the eFiction database. Why this issue crops up for them when it works fine for me, I don't know and I've run out of ideas to try.
Hey, is your CPG and eFiction tables in the same database?
(See my post above for the problem)
Quote from: vuud on March 28, 2007, 04:24:50 PM
Hey, is your CPG and eFiction tables in the same database?
(See my post above for the problem)
Two of my three installs (the live site and one test site) have the CPG and eFiction tables in a shared database. The third install, test2, has the CPG and eFiction tables in separate databases. That one is at http://test2.calic0cat.net/efiction - you can see that the page title has the word "test" in it, indicating that it's coming from my "test" database, while the first image in the "Most Recent" block has the word "test2" in its title, indicating that it's coming from my "test2" database. Why does this work with my setup and not with other people's? Presumably, something to do with the server's setup is forcing either PHP or MySQL to behave differently. Maybe the "extra web security" (which is apparently the mod_security apache module) is somehow responsible for this?
Quote from: Calic0cat on March 28, 2007, 07:01:07 PM
Two of my three installs (the live site and one test site) have the CPG and eFiction tables in a shared database. The third install, test2, has the CPG and eFiction tables in separate databases. That one is at http://test2.calic0cat.net/efiction - you can see that the page title has the word "test" in it, indicating that it's coming from my "test" database, while the first image in the "Most Recent" block has the word "test2" in its title, indicating that it's coming from my "test2" database. Why does this work with my setup and not with other people's? Presumably, something to do with the server's setup is forcing either PHP or MySQL to behave differently. Maybe the "extra web security" (which is apparently the mod_security apache module) is somehow responsible for this?
I don't really know why - I personally am satisfied with the identification of the symptom to the cause... I really had no idea eFiction even existed until I downloaded the code to look at this problem.
Here is the thing:
EFiction creates a connection to its table
CpmFetch creates a connection to its table
CpmFetch specifically calls mysql through its specific connection
Efiction creates its queries through the last created connection
So thats the problem. If you can create your CpmFetch object and get it to connect to the database before eFiction creates its own, they will work fine.
You can see this in the includes/dbfunctions.php file...
The dbconnect line returns the specific connection, but non of the queries are told about it!
Can I say for sure this is why they are having the problem and not others - well, no. But this is definatly why it is happening. The eFiction code does not take into account another db connection existing.
As I mentioned before the bad fix is to put it all into one db, the good is to teach efiction to handle co-existing with another program. This will fix the problem.
Now, mod_security could be exposing it or something more - by delaying the connection or something... I don't know much about that except that it does do some support for mysql injection attacks, so who knows. Maybe it is delaying the connection till it needs it...
I don't know, but the eFiction code should be fixed... thats my 0.02
Someone could probably hack a fix in, I would be tempted to do it myself, but I am really short on time :(
Quote from: Calic0cat on March 28, 2007, 07:01:07 PM
Two of my three installs (the live site and one test site) have the CPG and eFiction tables in a shared database. The third install, test2, has the CPG and eFiction tables in separate databases. That one is at http://test2.calic0cat.net/efiction - you can see that the page title has the word "test" in it, indicating that it's coming from my "test" database, while the first image in the "Most Recent" block has the word "test2" in its title, indicating that it's coming from my "test2" database. Why does this work with my setup and not with other people's? Presumably, something to do with the server's setup is forcing either PHP or MySQL to behave differently. Maybe the "extra web security" (which is apparently the mod_security apache module) is somehow responsible for this?
My theory could also be tested by editing index.php in the efiction stuff.
Before the include "header.php" line, add in the cpmfetch creation stuff - Specifically the:
(Change to reflect your directory structure)
include "./cpmfetch.php";
$objCpm = new cpm("./cpmfetch_config.php");
$objCpm->cpm_getMediaCount();
the do the rest elsewhere in the eFiction site. Ommit the close statement.
The last line there forces CpmFetch to establish the dbconnection - by design it waits until it actually needs one - so eFiction can create its own after.
Mind you this is just to prove it out...
Thanks Vudd I created a thread over at the eFiction forums. Hopefully their developers can look into fixing this problem. ( http://efiction.org/forums/index.php?topic=4960.0 )
As for making the changes you suggested to test it I'm not sure what you mean.
index.php is a blank file, you mean index.tpl file?
if I add that code to the index.tpl file it seems to just output it as plain text?
Apparently the admins at the eFiction forums consider it a security risk to tell anyone about this problem. So rather than fixing it ASAP they limit the knowledge about it to hidden forums. So my thread no long exists.
Quote from: lonebard on March 28, 2007, 10:28:16 PM
Apparently the admins at the eFiction forums consider it a security risk to tell anyone about this problem. So rather than fixing it ASAP they limit the knowledge about it to hidden forums. So my thread no long exists.
Seriously... they just deleted your post?
Amazing stuff... I will add it into my documentation...
Quote from: lonebard on March 28, 2007, 09:47:03 PM
Thanks Vudd I created a thread over at the eFiction forums. Hopefully their developers can look into fixing this problem. ( http://efiction.org/forums/index.php?topic=4960.0 )
As for making the changes you suggested to test it I'm not sure what you mean.
index.php is a blank file, you mean index.tpl file?
if I add that code to the index.tpl file it seems to just output it as plain text?
If I look at the code in the index.php file, I see stuff. It should not be blank...
Not the .tpl, it has to be executed in a php file...
They contacted me privately and pretty much said I should delete it or they would. So I removed it myself.
Ah sorry I'll try you suggestion again. I was opening the index.php from the SKIN of the site, not the main efiction one.
ok so my retarded self remembered got the right file, added the code...
include "../cpmfetch/cpmfetch.php";
$objCpm = new cpm("../cpmfetch/cpmfetch_config.php");
$objCpm->cpm_getMediaCount();
above the "include ("header.php");" line like you said.
Now maybe you can explain "do the rest elsewhere in the eFiction site. Ommit the close statement."?
Adding the code doesn't produce any errors :) ( which is good ) but I assume the above line is you trying to tell me to use some sort of code to display the images. ( Thank you sir )
Quote from: lonebard on March 28, 2007, 11:01:39 PM
ok so my retarded self remembered got the right file, added the code...
include "../cpmfetch/cpmfetch.php";
$objCpm = new cpm("../cpmfetch/cpmfetch_config.php");
$objCpm->cpm_getMediaCount();
above the "include ("header.php");" line like you said.
Now maybe you can explain "do the rest elsewhere in the eFiction site. Ommit the close statement."?
Adding the code doesn't produce any errors :) ( which is good ) but I assume the above line is you trying to tell me to use some sort of code to display the images. ( Thank you sir )
The rest being the call to display the photos...
Amazing stuff.
If it works, I will find a better opening line for you... one that does not waste a SQL call.
Ok, I reenabled the block to display the pictures and get this error...
QuoteFatal error: Cannot redeclare class cpm in /home/bgmasque/public_html/cpmfetch/cpmfetch.php on line 1437
Line 1437 is "} // end class"
Quote from: lonebard on March 28, 2007, 11:15:35 PM
Ok, I reenabled the block to display the pictures and get this error...
Line 1437 is "} // end class"
Oh your using someones plug in or something?
You need to remove those lines you added to the index.php from their plug in...
Otherwise, well, you are redeclaring the class :)
Hmm, maybe I need to read more of the cpmFetch Documentation.
If I edit the block to only have the line that wasnt in the index.php ( which is " $objCpm->cpm_viewLastAddedMedia(1,4);" ) I get this long winded error...
QuoteTable 'bgmasque_efic.cpg1410_pictures' doesn't exist
SELECT p.filepath AS pFilepath, p.filename AS pFilename, p.aid AS pAid, p.filesize AS pFilesize, p.title AS pTitle, p.caption AS pCaption, p.owner_name AS pOwner_name, p.owner_id as pOwnerId, p.ctime AS pCtime, p.hits AS pHits, p.pid AS pPid, p.pic_rating AS pPic_Rating, p.votes AS pVotes, p.pwidth AS pWidth, p.pheight AS pHeight, p.user1 as pUser1, p.user2 as pUser2, p.user3 as pUser3, p.user4 as pUser4, c.cid as cCid, c.name as cName, c.description as cDescription, c.pos as cPos, c.parent as cParent, c.thumb as cThumb, u.user_lastvisit AS uUser_lastvisit,u.user_regdate AS uUser_regdate,u.user_email AS uUser_email,u.user_profile1 AS uUser_profile1,u.user_profile2 AS uUser_profile2,u.user_profile3 AS uUser_profile3,u.user_profile4 AS uUser_profile4,u.user_profile5 AS uUser_profile5,u.user_profile6 AS uUser_profile6, a.aid AS aAid, a.title AS aTitle, a.description AS aDescription, a.visibility as aVisibility, a.pos as aPos, a.category as aCategory, a.thumb as aThumb, a.keyword as aKeyword FROM cpg1410_pictures AS p LEFT JOIN cpg1410_users AS u ON p.owner_id = u.user_id LEFT JOIN cpg1410_albums AS a ON p.aid = a.aid LEFT JOIN cpg1410_categories AS c ON a.category = c.cid WHERE 1 AND p.approved='YES' AND ((a.visibility = 0 OR a.visibility IS NULL) AND (a.alb_password IS NULL OR a.alb_password = "")) ORDER BY p.ctime DESC LIMIT 0,4
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/bgmasque/public_html/cpmfetch/cpmfetch_dao.php on line 1114
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/bgmasque/public_html/cpmfetch/cpmfetch_dao.php on line 1118
Quote from: lonebard on March 28, 2007, 10:28:16 PM
Apparently the admins at the eFiction forums consider it a security risk to tell anyone about this problem. So rather than fixing it ASAP they limit the knowledge about it to hidden forums. So my thread no long exists.
I believe that particular philosophy is to keep any potential security risk under wraps
while it is being fixed (since volunteer dev teams in general do tend to have actual paying day jobs that prevent instant release of fixes - plus it tends to take a while for users to update even after fixes are released). It is, generally speaking, considered good form to privately report potential security issues and give the developers a reasonable chance to deal with them before releasing information to the general public. And that applies whether in reference to free, open source software or to expensive commercial software.
ok.
Quote from: Calic0cat on March 29, 2007, 02:10:43 AM
I believe that particular philosophy is to keep any potential security risk under wraps while it is being fixed (since volunteer dev teams in general do tend to have actual paying day jobs that prevent instant release of fixes - plus it tends to take a while for users to update even after fixes are released). It is, generally speaking, considered good form to privately report potential security issues and give the developers a reasonable chance to deal with them before releasing information to the general public. And that applies whether in reference to free, open source software or to expensive commercial software.
Hmmm, from a programming standpoint I don't think its a security issue. I can't think of anyway to compromise a PHP script this way. To do so you would have to actually edit the pages or put more pages on the server, in which case you can do more damage by directly editing pages. Or reading the config files.
But anyway, it would be cool for them to fix it.
Quote from: lonebard on March 29, 2007, 02:00:42 AM
Hmm, maybe I need to read more of the cpmFetch Documentation.
If I edit the block to only have the line that wasnt in the index.php ( which is " $objCpm->cpm_viewLastAddedMedia(1,4);" ) I get this long winded error...
Oh that is #*)@ed up
It looks like its using the efiction mysql now... Is there any chance you would give me direct access to poke at it a bit? I am really a bit confused as to this behavior. If not, I dont blame you.
It's not my server but I'll get in contact with the person and ask their permission. Might be a couple days before I can contact them though.
Quote from: lonebard on March 29, 2007, 03:43:46 AM
It's not my server but I'll get in contact with the person and ask their permission. Might be a couple days before I can contact them though.
Well, I will mull it over some more... can you tell me what your cfUseExistingDBConnection thing (I forget the exact name) is set to right now?
Quote$config_overrides['cfUseExistingDBConnection'] = 'false';
Quote from: lonebard on March 29, 2007, 03:25:17 PM
crap.
I will think about this some more... it should not be doing this.
I wonder if they are only allowed one db connection... Hmmmm
You mean maybe the host limits things to one database connection at a time?
Quote from: lonebard on March 29, 2007, 10:40:42 PM
You mean maybe the host limits things to one database connection at a time?
I dunno... maybe... I am running out of ideas. Is it a "less expensive host"?
Here's the hosts list of plans. http://dwhs.net/web-hosting-plans.htm
I believe it's the Advanced plan. So it's not like a el cheapo set up.
Quote from: lonebard on March 30, 2007, 02:19:53 AM
Here's the hosts list of plans. http://dwhs.net/web-hosting-plans.htm
I believe it's the Advanced plan. So it's not like a el cheapo set up.
Well, they should definately not be blocking you on one connection for that amount
Quote from: lonebard on March 30, 2007, 02:19:53 AM
Here's the hosts list of plans. http://dwhs.net/web-hosting-plans.htm
I believe it's the Advanced plan. So it's not like a el cheapo set up.
If there is any chance you could PM me a phpinfo() output that would be great.
This is really bothering me.
Quote from: lonebard on March 30, 2007, 02:19:53 AM
Here's the hosts list of plans. http://dwhs.net/web-hosting-plans.htm
I believe it's the Advanced plan. So it's not like a el cheapo set up.
Ah-ha... I figured it out (again?). Its the same stupid problem with efiction and not specifiying a specific connection.
If you are still game to try it... do this:
Open up a copy of cpmfetch_dao.php for editing
Find the line that says this (its around 1231 in my version, which may be slightly different)
function dbExecuteSql ($sqlcode, $convert = true) {
$this->dbConnect();
$this->lastSQLRowsReturned = 0;
$this->lastSQLErrorMessage = "";
$results = array();
Then add this line:
mysql_select_db($this->cfg['dbname'], $this->dbconnection);
This forces CpmFetch to select the database again, its not efficent, but I suspect that the efiction system does the mysql_select_db something like this:
mysql_select_db($this->cfg['dbname']);
Which does the same thing as the other ones... hijacks the last connection. So they re-use ours, then change the database.
Hmm, that brings me back to this old friend...
QuoteA fatal MySQL error was encountered.
Query: SELECT message_text FROM fanfiction_messages WHERE message_name = 'welcome'
Error: (1146) Table 'bgmasque_coppermine.fanfiction_messages' doesn't exist
Quote from: lonebard on March 30, 2007, 03:57:18 AM
Hmm, that brings me back to this old friend...
GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
I've spent more time trying to work around this "feature" of eFiction (Feature in the Microsoft sense of the word) than I have on anything else.
Okay, see that same function? Down toward the bottom of it, just before the return, enter this:
mysql_select_db("Name of stupid efiction database here", $this->dbconnection);
This tells CpmFetch to set itself back to the... you know what, I am not even going to explain it this time. If people don't get the point that eFiction is not meant to co-exist with anything else....
#@@$&#@ *(#$@*9 #@9 $(!)$@()!$#@!!
I am gonna go hit something now... most likely with my head. With any luck I will forget this whole experience.
Its almost funny.
More than anything I hope this works for you...
Exact same problem.
Thanks for all your help. You've done MORE than I expected. I realize this problem exists because of the limitations eFiction has set forth. Which i tried to explain to this person before I started in on this project for them. Sadly because of their devs lack of enthusiasm I'm not sure how long it'll take for them to look into writing better code.
Quote from: lonebard on March 30, 2007, 05:20:08 AM
Exact same problem.
Thanks for all your help. You've done MORE than I expected. I realize this problem exists because of the limitations eFiction has set forth. Which i tried to explain to this person before I started in on this project for them. Sadly because of their devs lack of enthusiasm I'm not sure how long it'll take for them to look into writing better code.
I just want to clarify that you replaced "name of stupid efiction database" with the actual name???
lol good thing you did.
That code font is so small I didnt even notice. I'm just running on auto pilot now. I'll add the correct name and see what happens.
Hah, success! - Sort of.
Images show up, the eFiction page shows up. But the pictures are at the top of the page.
http://www.themasque.net/efiction/index.php
Quote from: lonebard on March 30, 2007, 03:23:28 PM
Hah, success! - Sort of.
Images show up, the eFiction page shows up. But the pictures are at the top of the page.
http://www.themasque.net/efiction/index.php
Oh thats funny... its all in CSS Layouts.
Anyway, if I look at your source for the page, the cpmfetch stuff is executing at the top.
You are on your own from here my friend :)
Cause this gets into an EFiction issue (placement and such) and I have learned enough about efiction already :p
Hmm, well thats odd because the cpmfetch code is inside a "block" and as such it's set to display inside the "Recent Images" box. I have no idea how it could be outside of that box but oh well. I'll continue to trouble shoot.
They don't appear up there because we put that code to initialize cpmFetch above the header in index.php?
Hmm. I actually removed the code from index.php and added all of it back to the block. If this block runs in the middle of a div why would the images appear at the top of the page? ... I maybe a novice with php but i cant explain the placement of the images by css.
Quote from: lonebard on March 30, 2007, 03:44:12 PM
Hmm. I actually removed the code from index.php and added all of it back to the block. If this block runs in the middle of a div why would the images appear at the top of the page? ... I maybe a novice with php but i cant explain the placement of the images by css.
It may be running in the div, but if you VIEW SOURCE on the page (at least the one you point to above) you will see its actually getting output before the html BODY tag.
As for the stuff we had in the index, that does not output anything, so it would not cause this.
Can you post the code you are using in your block? If you do not change the output type, it will shoot straight to the output.
The block contains this...
<?php
include "../cpmfetch/cpmfetch.php";
$objCpm = new cpm("../cpmfetch/cpmfetch_config.php");
$objCpm->cpm_getMediaCount();
$objCpm->cpm_viewLastAddedMedia(1,4);
?>
Quote from: lonebard on March 30, 2007, 06:23:20 PM
The block contains this...
<?php
include "../cpmfetch/cpmfetch.php";
$objCpm = new cpm("../cpmfetch/cpmfetch_config.php");
$objCpm->cpm_getMediaCount();
$objCpm->cpm_viewLastAddedMedia(1,4);
?>
I believe the original thread by Calic0cat contains setting the result set. I would review that thread...
Figured it out on my own. It was the php :P
Thanks so much for your help, is there somewhere that I can donate to this project?
Quote from: lonebard on March 30, 2007, 11:52:15 PM
Figured it out on my own. It was the php :P
Thanks so much for your help, is there somewhere that I can donate to this project?
No problem on the help.
Not really... People have sponsored functions they want added (ie: Buy me a pizza to do something), but other than that no. That gets sent through paypal, and typically I end up redirecting it to other opensource projects that I use. I can PM you my paypal stuff if you are interested in sponsoring a beer or pizza or something.
Thanks
Vuud