News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

MyStatus Update Mod (beta) - a social network extension for SMF 2.0

Started by ElectricSquid, October 15, 2009, 02:14:01 PM

Previous topic - Next topic

ElectricSquid

Quote from: ormuz on November 15, 2009, 12:14:01 PM
Is there a demo?

Not yet, I'm rewriting it's core code due to concerns from the customizer team.
It'll be a few more days till I get the last few bugs worked out.

ElectricSquid

I'm at a little bit of a stuck point.
How is $topic populated in Post2?

sangwe11

Quote from: ElectricSquid on November 15, 2009, 03:28:27 PM
I'm at a little bit of a stuck point.
How is $topic populated in Post2?

I thought you had dropped using the topics / posts ?

Arantor

It's actually done the same way it is throughout the rest of SMF, by looking in $_REQUEST['topic'].

ElectricSquid

Quote from: sangwe11 on November 15, 2009, 03:34:40 PM
Quote from: ElectricSquid on November 15, 2009, 03:28:27 PM
I'm at a little bit of a stuck point.
How is $topic populated in Post2?

I thought you had dropped using the topics / posts ?

In a forum board, I did.
But this mod acts almost identically to how topics and replies are done. So it would make logical sense to look at how topics and replies are posted, to get ideas on how to do it elsewhere.

Or no?

Arantor

Quote from: Arantor on November 15, 2009, 03:56:55 PM
It's actually done the same way it is throughout the rest of SMF, by looking in $_REQUEST['topic'].

ElectricSquid

Quote from: Arantor on November 15, 2009, 03:56:55 PM
It's actually done the same way it is throughout the rest of SMF, by looking in $_REQUEST['topic'].

The issue I'm having is...
OK, first you need so insight on what I did.
Basically, I grabbed the code from post2 and sub-post, since that was how I had this mod doing it before this huge change to it's own tables. That code now resides in it's own independent Source files. Index.php has been updated, and the forms have been updated. The new tables are also in the database as needed.

OK, now I can post a new topic (status update), that works as needed and returns me to the everyone page.
I can reply to ONE new topic, but every other new topic I try to reply to gives me this message...
"The topic or board you are looking for appears to be either missing or off limits to you."

But I can still reply to the one new topic that I successfully replied to the first time.

Unfortunatly I am having a huge problem figuring out where the issue is.

Arantor

If you're using $topic directly (which is a bad idea), it's defined in index.php during page load, directly from $_REQUEST.

I still don't know enough about what you're doing and how you're trying to do it.

What URL are you trying to access when you get that error?

ElectricSquid

Quote from: Arantor on November 15, 2009, 04:25:13 PM
If you're using $topic directly (which is a bad idea), it's defined in index.php during page load, directly from $_REQUEST.

I still don't know enough about what you're doing and how you're trying to do it.

What URL are you trying to access when you get that error?

It's a custom url and I'm working it all custom files at this point.
I have the issue rounded down to the fact that it only errors out on the first reply to a post.
I can post in any update already replied to, but if the update is new, it throws the error.

I'm still working on it.

Arantor

Then there's some faulty logic in your code somewhere if you're completely in a custom action.

ElectricSquid

Quote from: Arantor on November 15, 2009, 04:25:13 PM
If you're using $topic directly (which is a bad idea), it's defined in index.php during page load, directly from $_REQUEST.


Your advice was what I needed.
I was using $topic, which was a bad idea.
I switched that to $update and $_REQUEST['update'] and that damn near fixed the problem.

Thanks!!
After a few other minor tweaks, I have it functional now, and fully independent from SMF boards, database tables, and coding.

ElectricSquid

Quote from: Arantor on November 15, 2009, 10:08:27 PM
Then there's some faulty logic in your code somewhere if you're completely in a custom action.

LOL, :P rub it in why don't you :P

Hey, nice Code Monkey logo you have there.
Is that new? I haven't noticed it before.

Arantor

Quote from: ElectricSquid on November 15, 2009, 10:47:28 PM
LOL, :P rub it in why don't you :P

That wasn't what I was on about; simply that if you're using a custom action and not calling SMF functions, process of elimination says it's your custom code.

QuoteHey, nice Code Monkey logo you have there.
Is that new? I haven't noticed it before.

I switched my avatar to that yesterday. I'm feeling in a slightly frivolous mood, so will change my avatar around occasionally; I have a couple of others to run with yet...

ElectricSquid

What are all the parameters for $config_vars?
I can't find any documentation on it anywhere.

I looked at other mods to get an idea, but I don't exactly know what ALL the parameters are. Especially this last one.... ,'',

<?php

array('text''mystatus_update_txt','32','label' => $txt['mystatus_update_txt'], 'subtext' => $txt['mystatus_update_txt2']),'',

?>

ElectricSquid

I figured out the ,'', at the end, it's actually outside of the setting array, and somehow creates a <hr /> between settings.

I would still like to know the full range of options available for $config_vars if anyone knows where that info can be found.

Kays


If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Arantor

Parameters for $config_vars, by and large it's an array of arrays, with the subarrays being 2+ items, the first being the type of option (text, large_text, check, int, float), the second being the name of the entry in $txt and $modSettings that it needs to be.

size is used to dictate the size of the box, label is the text label it gets if you don't want to use the default auto populated one, subtext is a sub label it has.

You can simply define it as ('text', 'settingname') to have it saved into $modSettings['settingname'], use $txt['settingname'] and be a basic textbox.

The '' is not outside of the settings array, actually. The array is an array of arrays, really, with one array containing all the settings and each setting being an array or string (default label, not recommended), or '' for divider.

digit

Happily using a heavily modified 1.1.16 version of SMF!

2748011 Posts in 320998 Topics by 50986 Members


SOLD my website - thanks it was a good run - they converted to vbadvanced. (and screwed it up good!)

ElectricSquid

Quote from: Kays on November 18, 2009, 12:35:22 AM
Take a look in ManageServer.php for that.

Yup, there are a bunch of good examples of $config_vars there in that file
Here's one of them....
(< ?php is added just to make it colorful :P

<?php
/* If you're writing a mod, it's a bad idea to add things here....
For each option:
variable name, description, type (constant), size/possible values, helptext.
OR an empty string for a horizontal rule.
OR a string for a titled section. */
$config_vars = array(
array('mbname'$txt['admin_title'], 'file''text'30),
'',
array('maintenance'$txt['admin_maintain'], 'file''check'),
array('mtitle'$txt['maintenance_subject'], 'file''text'36),
array('mmessage'$txt['maintenance_message'], 'file''text'36),
'',
array('webmaster_email'$txt['admin_webmaster_email'], 'file''text'30),
'',
array('enableCompressedOutput'$txt['enableCompressedOutput'], 'db''check'null'enableCompressedOutput'),
array('disableTemplateEval'$txt['disableTemplateEval'], 'db''check'null'disableTemplateEval'),
array('disableHostnameLookup'$txt['disableHostnameLookup'], 'db''check'null'disableHostnameLookup'),
);
?>


ElectricSquid

... and I'm going to take a wild guess at it here, I'm guessing that the Help file text that can be added to the $config_vars array should be located in Help.english.php?

Advertisement: