Search

sorry, a mistake: in extensions files (extension.driver.php and data-sources) sql-queries not with sym but tbl!!

Why this forum-discuss changes tbl to sym automatically when i type tbl with underscore!!!?? Do you have such a crazy…?

Yeah, this is actually a Symphony bug because it runs the replace function against the entire SQL query, if you have the string t bl_ in your content it will also get replaced to sym_. So on the forum when you type t bl_ (no spaces) it’ll actually get replaced to sym_. A niggly bug.

With 2.2 being around the corner, and the new members extension close behind, I assume we’ll see an update to this ensemble in due time? Considering that you’re really good at keeping things updated, Stephen..

I guess I am just curious if this will actually require an almost full revamp, or are the existing extensions going to be pretty painless to get working under 2.2? Maybe they actually already do work? I suppose I could try it out with the release candidate..

I’m pretty excited to see what this can become with the official 2.2 / members extension.

It would have to be refactored, I’m afraid. The official members extension, when released, will not be compatible with or upgradeable from any of the older, unofficial, unsupported versions.

Thanks @czheng, I suppose it’s a good thing I’ve been waiting for the release of these to start on my next project.

That’s the case for the members extension then, is it also the case for the forum extension, or will that be a pretty smooth transition to 2.2? I’m just trying to get an okay idea of when I can actually start developing what I have in mind.

There is no forum extension. This is an ensemble, a purpose-built Symphony package that comes bundled with some extensions pre-installed and some setup already done. This ensemble would have to be refactored using the Symphony 2.2 and the new version of the members extension.

Make sense?

No, that makes sense and I understand that. But I suppose I am confused as there is, in this ensemble, an extension listed as “Forum”. And if I actually recall from memory correctly, Stephen said it was an extension sent to him via the staff? I could be very wrong there though.

But if the forum isn’t necessarily an extension.. that means I can start deving on the final 2.2 release.. then just add the member extension once it’s released. That sounds good to me.

Actually, there is a Forum extension. It is used to manage discussions in the Forum ensemble. Because the process of creating a dicussion involves the creation of two entries in two different sections simultaneously, this requires custom data sources and events. Then, there is functionality for member activation, forum administration and features that require additional data sources, events and classes.

Data Sources

  • Forum: Discussions
  • Forum: Discussions (Filtered)
  • Forum: Read Discussions List

Events

  • Forum: Activate Member
  • Forum: Discussions & Comments
  • Forum: Resend Activation Email
  • Forum: Utilities

Some of the features included in the Forum extension will be redundant with the release of the Core Email API and the stable Members extension. Others will still be required to provide the same functionality for the Forum ensemble.

Until the dust settles on the Members extension, it’s a little too early to tell what work will be needed to update the Forum extension and ensemble.

Ah, yes, you’re right. There were some things bundled together into an extension (custom events and data sources and such) that was at one point labeled “Forum.” All of that is unofficial and unsupported though. There is no official Forum extension, and there are no plans to build one.

What you’d be more likely to see instead is more granular extensions that can be useful in a forum context (stuff like “Read/Unread” functionality). But nothing official on that front at the moment either.

Hey Bauhouse, I read in another thread that you have been working on updating this ensemble to use 2.2 and the members extension..

I have been building my own discussion/forum system as well, and I have one more road block to get past.. Do you happen to have a solution to keeping track of read / unread comments? I can't seem to really wrap my head around how to go about doing this.

I'm not quite there yet. I haven't decided whether to use a custom table, similar to the original, or to create another section to track this. I think I first need to reverse engineer the original implementation to figure out the best approach.

I've been trying to build as much as I can with as little magic as possible. Using native events and data sources to replace the custom versions in the Forum ensemble. But when I look at the sym_forum_read_discussions table, I'm not sure where to start.

I suppose if it were to be a Section, it would contain the following fields:

  • Member (Select Box Link)
  • Discussion (Select Box Link)
  • Last Viewed (Date)
  • Comments (Number)

But building this as a section would mean several tables with a bunch of joins, and performance is eventually going to be an issue as the number of forum discussions and comments builds. Running a query on a single table is going to be much faster.

Here's the table structure of the sym_forum_read_discussions table:

CREATE TABLE `sym_forum_read_discussions` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `member_id` int(11) unsigned NOT NULL,
  `discussion_id` int(11) unsigned NOT NULL,
  `last_viewed` int(11) unsigned NOT NULL,
  `comments` int(11) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `member_id` (`member_id`,`discussion_id`)
) ENGINE=MyISAM AUTO_INCREMENT=106 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

It seems the most practical way of dealing with this is as an extension with some custom events and data sources. But this bit may be beyond my ability to figure out.

Ah, nice.. sounds like we're both on the same page as far as this is concerned. I do like how the current forum extension handles it, over using another section. Same reason, really, just because of how large that could potentially be.

I'll dig a bit deeper into the current extension, if I can figure out a working solution, I'll let you know to take a look at it. I'm probably only barely past novice when it comes to php though, so we'll have to see how it goes.

Well, no sense reinventing the wheel. There are definitely limitations to reproducing the forum functionality with native events and data sources, so I'm going to see how far I can get with adapting the Forum extension for use with the Members Beta extension.

So far I have enabled the ability to save the Forum extension preferences to the configuration file, now using Select Box Link fields instead of the memberlink field.

The ASDC extension will still be a dependency, but the ConfigurationAccessor class is now part of the Symphony core, so the Library extension is no longer a dependency.

The events are probably not safe to use yet, but I haven't tested those yet. I'm assuming that because they're still using logic to filter based on member role, that they are broken. I've removed the member activation events, but I'll see if I can clean up the others.

The ASDC extension will still be a dependency

Yeah, personally, I'm still using both ASDC and DatabaseManipulator, as they are dependencies of EventEx.. I kind of winced when I installed it, cause I know the members extension got rid of that dependency.. but it's a small price to pay to have multi-section submissions.

The forum extension doesn't use EventEx, but something similar (custom?), right? Is that where the ASDC dependency comes in, or is it for something else?

ASDC is used to build the SQL queries for the discussions and comments in the custom data sources. It looks like there are alternatives, such as SymQL and SymQuery, but I'm not very familiar with SQL.

Because of the complexity of these queries, I don't think I'd be very interested in trying to rewrite them to be compatible with these more recently released extensions, unless someone knew there was a good reason to use them over the ASDC extension.

ASDC is nothing more than a replacement for the MySQL class in Symphony. It's a database connector that doesn't really do much that is Symphony-specific — it still executes plain text SQL queries.

You can replace ASDC query calls with a Symphony::Database()->query(...) call.

Thanks, Nick.

ASDC must have a few extras. I am trying to update this custom data source for the Forum extension. It looks like this Forum: Discussions data source is working now.

I was going to see if I could replace all the ASDC ASDCLoader::instance()->query() calls with Symphony::Database()->query(), but this data source returns the following error:

Fatal error: Call to a member function length() on a non-object in /Users/stephen/Sites/domain7/team-members/extensions/forum/data-sources/data.forum_discussions.php on line 48

That refers to this code:

if($rows->length() > 0){
    foreach($rows as $r){
        self::$_fields[$r->section][$r->handle] = $r->id;
    }                           
}

So, I saw that core classes were testing whether the query result was empty or not in a different way:

if(is_array($rows) && !empty($rows)){
    foreach($rows as $r){
        self::$_fields[$r->section][$r->handle] = $r->id;
    }                           
}

Then, I come across another error:

Fatal error: Call to undefined method MySQL::lastError() in /Users/stephen/Sites/domain7/team-members/extensions/forum/data-sources/data.forum_discussions.php on line 128

which I attempt to fix by replacing $db->lastError() with $db->getlastError(). So, the PHP errors are gone, but my data source just returns an error node:

<forum-discussions>
    <error>0: Table 'domain7_team-members.sym_entries_data_0' doesn't exist on query 1146</error>
</forum-discussions>

ASDC provides a more OOP interface to the queries, so as Nick said, you should generally be able to port it to across to the core style. Generally the OOP interface is used to iterate over the results, so the foreach is good place to start when porting.

For what it's worth, S3 shares a similar OOP interface to the Database.

I'm getting close to finishing up the updates to the Forum extension and the Forum Ensemble. If anyone is looking for an example of how a Members site can be set up, including integration with the Email Template Manager, the Forum ensemble gives a fairly good working example. It's not as polished as Michael's Members Forms, but it seems to work. To install with Git, clone the repository and recursively initialize and clone the submodules:

git clone --recursive --branch core git://github.com/domain7/sym-forum-ensemble.git

But it looks like I'm going to need some guidance in setting Members Role permissions. At the moment, I'm running into errors with the Forum events. When trying to create a new discussion or a new comment, I get the following error:

Fatal error: Call to a member function canProcessEvent() on a non-object in /Users/stephen/Sites/sym/forum-update/extensions/forum/events/event.forum_post.php on line 250

I can get the events working by disabling the permissions for the Forum events.

With Members 1.0, I am no longer seeing the list of Forum events on the Member Roles page for Event Level Permissions. How do I go about managing permissions for these events?

That error means that your RoleManager::fetch call is not returning a Role. That function accepts a Role's ID.

When you say 'not see', do you literally mean they don't appear on that page? Or appear but aren't able to be clicked? If it's the former, can they be seen on the Components page? Members just uses the EventManager::listAll method, so it would be unusual if it appeared in one area but not the other.

If it's the latter, ensure that ignoreRolePermissions is not in your events (and returning true).

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details