[DEV] Post to Multiple Forums

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Locked
Night4554
Registered User
Posts: 99
Joined: Sun Apr 07, 2002 3:09 am

[DEV] Post to Multiple Forums

Post by Night4554 »

1) This is DEV! I will make it beta or alpha or theta or whatever when I actually have some code i could release, and not developing it from scratch right here.

OKAY: THIS IS NOT A MOD CODE
DO NOT EDIT YOUR FILES


So, I'm aiming for a list of all the forums with check boxes next to them (along with a Check All button, but that later) in a table row between the Subject feild and the upper row of BBCodes.

To do that, I guess I'll run an sql query something like:

Code: Select all

$sql = "SELECT forum_name, forum_id 
FROM " . FORUMS_TABLE . "
ORDER BY forum_id";
if( !($result = $db->sql_query($sql)) )
{
	message_die(GENERAL_ERROR, 'Can't Grab Forum Names', '', __LINE__, __FILE__, $sql);
}
while (($forum_names[] = $db->sql_fetchrow($result)));
$total_forums = count($forum_names)-1;
Then some code in posting.php

Code: Select all

for($i = 0; $i < $total_cats; $i++) { // loop through cats 
		$template->assign_block_vars('catrow', array(
			'FORUM_NAME' => $forum_names[$i]['forum_name'],
			'FORUM_ID' => $forum_names[$i]['forum_id']
			)
		);			
}
And somewhere else I got to put something that registers that in all the forums right? posting.php right?

Okay, I've found this:

Code: Select all

submit_post($mode, $post_data, $return_message, $return_meta, $forum_id, $topic_id, $post_id, $poll_id, $topic_type, $bbcode_on, $html_on, $smilies_on, $attach_sig, $bbcode_uid, str_replace("\'", "''", $username), str_replace("\'", "''", $subject), str_replace("\'", "''", $message), str_replace("\'", "''", $poll_title), $poll_options, $poll_length, $msg_icon);
So I figured somehting like:
for($i=something;$i<=something;$i++)
{
submit_post($mode, $post_data, $return_message, $return_meta, $forums[$i], $topic_id, $post_id, $poll_id, $topic_type, $bbcode_on, $html_on, $smilies_on, $attach_sig, $bbcode_uid, str_replace("\'", "''", $username), str_replace("\'", "''", $subject), str_replace("\'", "''", $message), str_replace("\'", "''", $poll_title), $poll_options, $poll_length, $msg_icon);
}


But the biggest help i need is where it accepts those values and passes them to the function, and how to store all the values into an array.




OKAY: THIS IS NOT A MOD CODE
DO NOT EDIT YOUR FILES
conanqtran
Registered User
Posts: 308
Joined: Tue Mar 26, 2002 4:19 am
Contact:

Post by conanqtran »

what is the purpose of this? u can just use the global announcement mod made by niels :D
Night4554
Registered User
Posts: 99
Joined: Sun Apr 07, 2002 3:09 am

Post by Night4554 »

No...... that posts it to EVERY Forum, and I just want to post to MULTIPLE Forums.
R45
Registered User
Posts: 2830
Joined: Tue Nov 27, 2001 10:42 pm

Post by R45 »

You could just have the posted screen (after you click post) just get the same forum list again and match all the vars that have been passed checked. Remember you need to select forums based on permissions also. Then its easy to loop those checked forums and use submit_post
DJ P@CkMaN
Registered User
Posts: 194
Joined: Thu Jun 06, 2002 12:55 am
Location: Brisbane, Australia
Contact:

Post by DJ P@CkMaN »

If it was me, I would just be slack and do the whole post thing through SQL and not worry about any phpBB functions :wink:
User avatar
tjsundling
Registered User
Posts: 10
Joined: Fri Sep 20, 2002 8:52 pm

Post by tjsundling »

Have you gotten any further with this mod? I would like to do exactly what you are trying to do.
DanielT
Former Team Member
Posts: 3324
Joined: Tue Aug 27, 2002 10:55 am
Contact:

Post by DanielT »

DJ P@CkMaN wrote: If it was me, I would just be slack and do the whole post thing through SQL and not worry about any phpBB functions :wink:


yup
User avatar
tjsundling
Registered User
Posts: 10
Joined: Fri Sep 20, 2002 8:52 pm

Post by tjsundling »

If it was me, I would just be slack and do the whole post thing through SQL and not worry about any phpBB functions

This is all well and good for site admins and SQL admins, but what about the normal user? I would like to have normal users of the forum be able to post into multiple forums at the same time (without them having access to my mySQL database). Or am I just misunderstanding what it is you're suggesting I do?
User avatar
DivScript
Registered User
Posts: 62
Joined: Tue Oct 22, 2002 8:10 pm
Location: United Kingdom
Contact:

Post by DivScript »

This sounds like a really good mod, because that global announcement mod is utterly stupid. It f***** my board up because the instructions are not correct !!DELETE THE GLOBAL ANNOUNCEMENT MOD OR TELL THE AUTHOR TO RETHINK HIS HELP FILE PLS KTHX!!.
If I could help, I would because this is a really good idea.

Dave.
User avatar
tuck
Registered User
Posts: 222
Joined: Mon Jul 01, 2002 8:13 pm

Well

Post by tuck »

actually the Global Announcements are working fine for me, what problems did you have?
User avatar
tjsundling
Registered User
Posts: 10
Joined: Fri Sep 20, 2002 8:52 pm

Post by tjsundling »

I am using the global announcement mod, which works, but not for what I would like this mod described in the first post of this topic to do. They are completely different mods with completely different purposes in my mind. So please keep their discussions separate.

I know a mod of this nature would be possible (if I knew how to code it I would), and rather useful. For example: If I wanted to post the same question to multiple forums for a response from people watching those specific forums, I would be able to post a topic and then select the forums I would like that message posted to by ctrl clicking a dropdown list.

I know I could go to each forum specifically and post a topic in each one manually, but when the number of topics is more than even 10 that I would like to post, it gets rather annoying. The global announcement mod would not work in this example because for one, it is "global" and for two, users are not able to respond to it (at with least the global announcement mod I am using).
User avatar
DivScript
Registered User
Posts: 62
Joined: Tue Oct 22, 2002 8:10 pm
Location: United Kingdom
Contact:

Post by DivScript »

The way the global announcements mod install file was worded, didn't make sense.
Therefore the files I edited screwed my board up.
I could login and whatnot, but I could not enter a specific forum, because some gay 'parse' error was displayed.
Therefore I think this mod would help me bunches, because it's better.
Keep it up.

Dave.
Night4554
Registered User
Posts: 99
Joined: Sun Apr 07, 2002 3:09 am

Post by Night4554 »

I got a pm about this, so I though I'd post:

I'm not developing this mod at all anymore; it's need has gone the way of the DooDoo for me. If anyone wants to take what I posted up there and work on it; go for it. I can edit anything you want into the first post if you pm me.
Brandons
I am too lazy to register

Post by Brandons »

Topic Locked. You have not released the mod-code in two months.

PM me if you decide to continue development on this.
Locked

Return to “[2.0.x] MODs in Development”