Advertisement:

Author Topic: Would it be a bad idea to add a second user to the smf database?  (Read 650 times)

Offline themavesite

  • Jr. Member
  • **
  • Posts: 183
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

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,375
    • StoryBB/StoryBB on GitHub
Re: Would it be a bad idea to add a second user to the smf database?
« Reply #1 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.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline themavesite

  • Jr. Member
  • **
  • Posts: 183
Re: Would it be a bad idea to add a second user to the smf database?
« Reply #2 on: January 16, 2018, 06:20:32 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

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,375
    • StoryBB/StoryBB on GitHub
Re: Would it be a bad idea to add a second user to the smf database?
« Reply #3 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.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,419
  • Gender: Male
    • Kindred-999 on GitHub
Re: Would it be a bad idea to add a second user to the smf database?
« Reply #4 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.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline themavesite

  • Jr. Member
  • **
  • Posts: 183
Re: Would it be a bad idea to add a second user to the smf database?
« Reply #5 on: January 16, 2018, 08:20:31 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.

Code: [Select]
<?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

Offline Aleksi "Lex" Kilpinen

  • A Peculiar Finn
  • Lead Support Specialist
  • SMF Super Hero
  • *
  • Posts: 18,535
  • Gender: Male
  • Don't worry, I'm n00b friendly
    • Aleksi.Kilpinen on Facebook
    • LexArma on GitHub
    • aleksi-kilpinen on LinkedIn
    • There's No Place Like 127.0.0.1
Re: Would it be a bad idea to add a second user to the smf database?
« Reply #6 on: January 16, 2018, 12:27:52 PM »
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?
A Finnish Support Specialist
 Happily running multiple SMF 2.0 installations.
  Fooling around with an i7 990X @ 3,47Ghz / 12Gb / Win 10 x64 / 3840x2160


How you can help SMF

"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

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,375
    • StoryBB/StoryBB on GitHub
Re: Would it be a bad idea to add a second user to the smf database?
« Reply #7 on: January 16, 2018, 01:07:14 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.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Aleksi "Lex" Kilpinen

  • A Peculiar Finn
  • Lead Support Specialist
  • SMF Super Hero
  • *
  • Posts: 18,535
  • Gender: Male
  • Don't worry, I'm n00b friendly
    • Aleksi.Kilpinen on Facebook
    • LexArma on GitHub
    • aleksi-kilpinen on LinkedIn
    • There's No Place Like 127.0.0.1
Re: Would it be a bad idea to add a second user to the smf database?
« Reply #8 on: January 16, 2018, 01:10:51 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
A Finnish Support Specialist
 Happily running multiple SMF 2.0 installations.
  Fooling around with an i7 990X @ 3,47Ghz / 12Gb / Win 10 x64 / 3840x2160


How you can help SMF

"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

Offline themavesite

  • Jr. Member
  • **
  • Posts: 183
Re: Would it be a bad idea to add a second user to the smf database?
« Reply #9 on: January 17, 2018, 04:06:22 AM »
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

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,375
    • StoryBB/StoryBB on GitHub
Re: Would it be a bad idea to add a second user to the smf database?
« Reply #10 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.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Pipke

  • Full Member
  • ***
  • Posts: 473
    • [NRNS]
Re: Would it be a bad idea to add a second user to the smf database?
« Reply #11 on: January 17, 2018, 06:16:48 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

Offline Aleksi "Lex" Kilpinen

  • A Peculiar Finn
  • Lead Support Specialist
  • SMF Super Hero
  • *
  • Posts: 18,535
  • Gender: Male
  • Don't worry, I'm n00b friendly
    • Aleksi.Kilpinen on Facebook
    • LexArma on GitHub
    • aleksi-kilpinen on LinkedIn
    • There's No Place Like 127.0.0.1
Re: Would it be a bad idea to add a second user to the smf database?
« Reply #12 on: January 17, 2018, 11:01:27 AM »
This is the answer though. No, multiple users is not a problem in itself.

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.
A Finnish Support Specialist
 Happily running multiple SMF 2.0 installations.
  Fooling around with an i7 990X @ 3,47Ghz / 12Gb / Win 10 x64 / 3840x2160


How you can help SMF

"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