Would it be a bad idea to add a second user to the smf database?

Started by themavesite, January 16, 2018, 05:28:57 AM

Previous topic - Next topic

themavesite

I was thinking of adding a second user to the smf database (read only rights) to automatically generate a website outside of SMF. (same server of course)
Let's say for example I post cars daily in a thread, it would be great to display all the replies made by me (sql query shouldn't be too hard) from that topic from new to old.

I'm kinda doing the same thing already but just by using the recent_posts template: https://themavesite.com/cars/ to generate posts from http://forums.themavesite.com/index.php?topic=6476.new#new
Only problem is that I'm limited to 100 results and I don't get as much freedom as I want.

If adding a second read-only user to the database is safe, I could generate content with some sql queries, and cache that content to only scrape once every 30mins.

Thoughts?
TMS Forums
Since 2008 and still going strong! Join today! http://forums.themavesite.com/index.php

Arantor

SMF actually provides for this itself, see the ssi_db_user configuration, for using SSI with that.

themavesite

Quote from: Arantor on January 16, 2018, 05:38:17 AM
SMF actually provides for this itself, see the ssi_db_user configuration, for using SSI with that.
But say I don't want to use SSI, would it be a bad idea to simply add another user to the database with read-only rights?

Or are you saying I don't have to use SSI, but can use the database user used for SSI functionality?
TMS Forums
Since 2008 and still going strong! Join today! http://forums.themavesite.com/index.php

Arantor

I'm saying that SMF is completely fine with it, that it isn't a bad idea and that the system already does this in places.

Though doing it across servers implies granting access to the DB directly (bad idea normally unless you control the cluster) which is why using APIs like SSI are a much better idea.

Kindred

As Arantor says...   SSI can already do exactly what you asked for.
No need to write any SQL...  especially since, invariably, such SQL would not be hardened.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

themavesite

Quote from: Kindred on January 16, 2018, 06:38:58 AM
As Arantor says...   SSI can already do exactly what you asked for.
No need to write any SQL...  especially since, invariably, such SQL would not be hardened.

Getting topics from a board category is easy with SSI, the sample code is out there.

<?php

ssi_boardNews
($board 5.0$limit 500$start null$length 250$output_method 'echo');

?>



But I want to show ALL topics (no limit, let me worry about paging and caching) and only if they were made by a specific user. To my knowledge this is not possible with SSI currently?
While in SQL I could write this up rather quickly.
TMS Forums
Since 2008 and still going strong! Join today! http://forums.themavesite.com/index.php

Aleksi "Lex" Kilpinen

Quote from: themavesite on January 16, 2018, 08:20:31 AM
But I want to show ALL topics (no limit, let me worry about paging and caching) and only if they were made by a specific user. To my knowledge this is not possible with SSI currently?
I'd say you don't really want to be doing that - not with the same database the forum is actively using. I am curious, why would you want this?
Slava
Ukraini!


"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Arantor

Quote from: Aleksi "Lex" Kilpinen on January 16, 2018, 12:27:52 PM
I'd say you don't really want to be doing that - not with the same database the forum is actively using. I am curious, why would you want this?

I long ago learned to stop worrying if users were going to shoot themselves in the foot.

Aleksi "Lex" Kilpinen

Quote from: Arantor on January 16, 2018, 01:07:14 PM
Quote from: Aleksi "Lex" Kilpinen on January 16, 2018, 12:27:52 PM
I'd say you don't really want to be doing that - not with the same database the forum is actively using. I am curious, why would you want this?

I long ago learned to stop worrying if users were going to shoot themselves in the foot.

I guess that comes with the 50K posts you have more than me. :P
Slava
Ukraini!


"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

themavesite

Quote from: Arantor on January 16, 2018, 01:07:14 PM
Quote from: Aleksi "Lex" Kilpinen on January 16, 2018, 12:27:52 PM
I'd say you don't really want to be doing that - not with the same database the forum is actively using. I am curious, why would you want this?

I long ago learned to stop worrying if users were going to shoot themselves in the foot.

You said that to me probably like 5 times already in the past. Fortunately you were never right  ;D
TMS Forums
Since 2008 and still going strong! Join today! http://forums.themavesite.com/index.php

Arantor

Thanks for the confidence booster, really appreciate that.

I'm sorry for trying to be useful and will stop doing that in future.

Pipke

Quote from: Arantor on January 17, 2018, 04:11:42 AM
Thanks for the confidence booster, really appreciate that.

I'm sorry for trying to be useful and will stop doing that in future.

lol
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

Aleksi "Lex" Kilpinen

This is the answer though. No, multiple users is not a problem in itself.

Quote from: Arantor on January 16, 2018, 06:35:19 AM
I'm saying that SMF is completely fine with it, that it isn't a bad idea and that the system already does this in places.

Though doing it across servers implies granting access to the DB directly (bad idea normally unless you control the cluster) which is why using APIs like SSI are a much better idea.
Slava
Ukraini!


"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Advertisement: