Jump to content

Profile custom plugins, profile tab by URI


Guest Oncle Tom

Recommended Posts

Hello,

I\'ve upgraded to IP.Board 2.2.0 yesterday and everything went fine. My members are all glad by this new version and especially the new portal-style profile page. I already built a little profile plugin I\'ve placed in sources/components_public/profile. This system is pretty cool because I won\'t have to modify the sources/action_public/profile.php each time I upgrade IP.Board.

I have two questions about all this.

1) Using db->build_query() with a non-ibf table
I tried to build a query to gather informations in a non-ibf table (I integrated IPB in the website) and I get errors even if the query was well formed. By looking at the logs (I\'ve got a thing to tell about this later), I noticed the ibf_ prefix was systematicaly added in front of the table names. A quick look in the DB class and I found the variable $this->obj[\'sql_tbl_prefix\'] in front of every table names.

Is there a way to construct a query with db->build_query() by properly overriding this table prefix ? I tried to play a little with $this->prefix_changed (turning it to 1 before the query) but it changed nothing.
Just for information, I built the query with db->query() method as I could hardcode full table names. Maybe is it a better solution ?

2) Opening a profile tab by URI
When a profile page is opened, the first tab is always loaded by default. Can a tab be opened by an URI like index.php?viewprofile=1&tab=posts ? It would be good for spider engines which could also go through real href links (considering they have JS turned off). It is also a good accessibility trick for other people who don\'t have JS enabled or because they can\'t have it enabled.

3) Other things
Is this normal the sql_log*.cgi is reckognized as an unknown IPB file by the security checker ? It could be great if this log could be watched directly through the ACP.

Thanks :)

Link to comment
Share on other sites

1) This is modification assistance, and really should be posted on IPS Beyond. But you need to set a db property before running your query (prefix_changed or something of that nature) and then reset it afterwards. Look through the ips_kernel/class_db.php file

2) I'd have to doublecheck, but I don't think so

3) Yes, it's normal. IPB has no way to know it's valid and not some file a hacker uploaded.

Link to comment
Share on other sites

OK nice. For the build_query thing, I don't want a a mod to be installed. It was rather a dev question to know if there was an advise on how proceding.

I've just found for the second point ! I've received an email telling me a friend added me to his buddy list. I saw in the URI &tab=settings ... I replaced "settings" by my custom plugin ID and it worked. It works with the showuser param like :
index.php?showuser=1&tab=comment
Could it be added in tabs URI ? Just for people without Javascript and Spider bots ? Thanks :)

Thanks for the DB log too ;)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...