TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,913
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 413
  • Total: 413

Database connection with External article

Started by azaslavsky, May 27, 2010, 10:42:57 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

azaslavsky

#10
Unfortunately, I am on a shared server, so I don't have access to that.

Also, completely unrelated, but is it possible to make articles have titles, and not just numbers, in the URL?  Eg, instead of "http://www.test.com/index.php?page=8", something like "http://www.test.com/index.php?page=somename"?

IchBin

On a shared server, they should still be giving you access to a access_log and an error_log. If you have CPanel, there is a section in there where you can actually view or download the log for your sites.

ZarPrime

#12
Quote from: azaslavsky on June 01, 2010, 09:57:48 PM
Also, completely unrelated, but is it possible to make articles have titles, and not just numbers, in the URL?  Eg, instead of "http://www.test.com/index.php?page=8", something like "http://www.test.com/index.php?page=somename"?

Sure, you can do that.  On the edit page for the particular article look for "Query title:" under "[Preview]Title:"  The query title that you choose can be used in place of the page number.

For instance, on my test site, both of these are the same ...
http://talesofthehavenexpanse.com/smf2test/index.php?page=Board1
http://talesofthehavenexpanse.com/smf2test/index.php?page=13

ZarPrime

azaslavsky

Quote from: IchBinâ„¢ on June 01, 2010, 10:01:55 PM
On a shared server, they should still be giving you access to a access_log and an error_log. If you have CPanel, there is a section in there where you can actually view or download the log for your sites.

Okay, found it.  This is the closest I have to a file not found error:
"File does not exist: /users/tsc/apache2/http-www/htdocs/test/Themes/default/css/firefox.css, referer: http://www.mysite.edu/test/index.php?page=7;tpreview"

However, the absence of a CSS file hardly seems like a reason to show nothing at all.

IchBin

Hmm... well sorry but there's really not enough information in that log then to give much more help.  There should be at least something showing that eval() has a problem.

azaslavsky

#15
Quote from: IchBinâ„¢ on June 01, 2010, 10:44:01 PM
Hmm... well sorry but there's really not enough information in that log then to give much more help.  There should be at least something showing that eval() has a problem.

Well, all of the eval errors are from the article edits, not the article itself, but...
[Tue Jun 01 13:37:57 2010] [error] [client 127.0.0.1] PHP Parse error:  syntax error, unexpected '/' in /users/tsc/apache2/http-www/htdocs/test/Sources/TPSubs.php(1730) : eval()'d code on line 4, referer: http://mysite.edu/test/index.php?action=tpadmin;sa=editarticle7

and
[Tue Jun 01 13:38:59 2010] [error] [client 127.0.0.1] PHP Parse error:  syntax error, unexpected '<' in /users/tsc/apache2/http-www/htdocs/test/Sources/TPSubs.php(1730) : eval()'d code on line 1, referer: http://www.mysite.edu/test/index.php?action=tpadmin;sa=editarticle7

azaslavsky

Okay, I got it to load using the include method, but once again, everything works except for the DB connection.  The iframe method works fairly well, but that of course raises the issue of posting data to the page in the iframe and ensuring secure access.  Oh well, I guess I'll go with that for now, though I am disappointed the External article method failed.

azaslavsky

Quote from: JPDeni on June 01, 2010, 08:55:20 PM
You might want to just use an iframe, with your external pages dealing with the external database. I think that would work.

Quoteso then should I use the SMF Mysql protocol to retrieve my data?

Only if you move your tables into the same database where SMF and TP reside.

While I have tried implementing this, my problem is that one of the main reason's I moved to SMF/TP is that I want control over which users can access which articles, something which SMF/TP has excellent tools for.  An iframe, while technically allowing me that control, is also a great hinderance, since users could just bypass the iframe and go to the page directly.  The only ways to pass variables from the page to its iframe are client-side, meaning that users can manipulate them and then access the tool in the iframe without having the proper permissions, something that is a pretty big deal since users pay for various parts of the application.

Oh well, I guess what I was looking for was a way to easily move my application into the SMF/TP ecosystem; I guess I will just have to bite the bullet and switch to the SMF database query method.

This website is proudly hosted on Crocweb Cloud Website Hosting.