Please do not visit, its a trap for bots
NukeXchange Network

          

Nuke Sites Link Directory
Nuke FixesNukeForumsNukeZone HostingNuke SitesNuke Skins
Nuke Resources
 :: Home  :: Downloads  :: Your Account  :: Forums  :: Advertise :: 
Login or Register
Main Menu
General
 Main
 AvantGo
 Banner_Clients
 cfaq
 Donations
 Downloads
 Forums
 Members_List
 Private_Messages
 Search
 Stories_Archive
 Submit_News
 Surveys
 Topics
 Web_Links
 Your_Account

Your Account
 Login
 Register
 Lost Pass

Modules
Quick Links
Domain Names
. Game Quest
Learning Linux
. MateMaker
NukeFixes
NukeForums
Nuke Sites
Nuke Skins
NukeZone Hosting
. SearchDevil
Other Options

Download Resources
Nuke Downloads
Add a Link
New Files
Top Rated
Most Popular

Web Site Resources
Nuke Sites
Add A Site
New Sites
Top Rated
Most Popular

Support
NukeZone Hosting
NukeSkins.com
NukeForums.com
phpnuke.org
NukeFixes.com
Information
NukeForums
·403 Forbidden

Forbidden

You don't have permission to access /backend.phpon this server.

Additionally, a 403 Forbiddenerror was encountered while trying to use an ErrorDocument to handle the request.

" target="_blank">403 Forbidden


read more...
Top10 Links
· 1: Nuke Forums
· 2: Windows Installation: PHP
· 3: PHPNukeFiles
· 4: NukeSkins
· 5: Nuke Templates
· 6: EcomJunk
· 7: FLASH-FOR-NUKE
· 8: MDesign
· 9: Dezina
· 10: Global Dream News Sharing Portal!
Site Visitors
User Login:

Nickname:
Password:
Security Code: Security Code
Type Security Code Here:

Members List Membership:
Latest: TommiePea
Today: 0
Yesterday: 0
Overall: 24467

Visitation:
Guests: 308
Members: 0
Total: 308


You are Anonymous user. You can register for free by clicking here
Sponsor Links
php-Nuke Themes and Templates
php-Nuke Themes and Templates

NukeResources :: View topic - Posting to phpBB (PHP-Nuke integration version) from a Form
NukeResources Forum Index

NukeResources Forum Index -> Random Thoughts -> Posting to phpBB (PHP-Nuke integration version) from a Form
Post new topic  Reply to topic    View previous topic :: View next topic 
Posting to phpBB (PHP-Nuke integration version) from a Form
PostPosted: Wed Feb 27, 2008 9:08 am Reply with quote
Loper
Resource Seeker
Resource Seeker
 
Joined: Feb 21, 2008
Posts: 10




I'm using a nice web form module/block called "Application" on my site that is for guild membership application (the site is for a warcraft guild) and it works great. Potential applicants fill out the form and a mail is generated as expected.

However, I'd like to take this to the next level and have it not only generate and send the mail but also create a forum post containing the details of the application, not unlike the mail generated. Most of that is easy enough for me to hack, and I don't want to do anything fancy with the formatting. Also worth noting is that the user must already be logged into the CMS to have access to the module, so I don't think that authentication should be an issue.

I've played around some with a php class file written for Drupal called phpbb.php that contains, among others, a function called "new_topic" that uses cUrl to insert a post into phpBB. Thing is, this doesn't seem to be working right with the Nuke integration. Anyone happen to have done something like this before? or have some idea of what variables I may need to set or includes I need to call in my "other" php files to get CMS auth to work in the background and get this to post?

Here is the one function out of the class that I'm most interested in; if helpeful I can post the whole class (I didn't write this):

Code:

   /*
      @ Function   : new_topic() - New Topic
      @ About      : Remotely posts a topic to the target phpBB forum.
      @ Type      : Public
   */
   function new_topic($forum_id, $message, $topic_title)
   {
      global $_SERVER;

      // Generate post string
      $post_fields = $this->array_to_http(array(
         'post'            => 'Submit',
         'mode'            => 'post',
         'message'         => $message,
         'f'               => $forum_id,
         'subject'         => $topic_title,
         'disable_bbcode'   => 0,
         'disable_smilies'   => 0,
         'attach_sig'      => 0,
         'topictype'         => 0,
      ));
      // Location
      $url_vars = $this->array_to_http(array(
         'mode'   => 'post',
         'f'      => $forum_id,
      ));
      // Init curl
      $this->curl = curl_init();
      // Set options
      curl_setopt ( $this->curl, CURLOPT_URL, $this->phpbb_url . $url_vars );
      curl_setopt ( $this->curl, CURLOPT_FOLLOWLOCATION, 0);
      curl_setopt ( $this->curl, CURLOPT_POST, true );
      curl_setopt ( $this->curl, CURLOPT_POSTFIELDS, $post_fields );
      curl_setopt ( $this->curl, CURLOPT_RETURNTRANSFER, true );
      curl_setopt ( $this->curl, CURLOPT_HEADER, false );
      curl_setopt ( $this->curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT'] );
      // Execute request
      $result = curl_exec ( $this->curl );
      echo $result;
      // Get the result
      if ( preg_match ( '#<td><span>Your message has been entered successfully.<br><br>#is', $result, $match ) )
      {
         $post_status = 1;
      }
      else if ( preg_match ( '#<td><span>You cannot make another post so soon after your last; please try again in a short while.</span></td>>#is', $result, $match ) )
      {
         $post_status = 0;
      }
      else
      {
         $post_status = 0;
      }
      // Error handling
      if ( curl_errno ( $this->curl ) )
      {
         $this->error = array(
            curl_errno($this->curl),
            curl_error($this->curl),
         );
         curl_close ( $this->curl );
         return false;
      }

      // Close connection
      curl_close ( $this->curl );
      // Return result
      return $post_status;
   }

And I call the function (after the class is instantiated as $phpbbclass) like so:
Code:

$phpbbclass = new curl_phpbb('modules.php?name=Forums&file=posting');
$phpbbclass->new_topic( 2, $msg, $subject );

2 is the forum ID I'd like to post to and both $msg and $subject contain non-array data that are correct.

I've been wrestling with this for nearly 2 weeks now and am ready to ask for some help. Hopefully someone has done this for Nuke.

Here is the main reference site where I've been looking at code, trying to hack it to work with Nuke, including the code examples above:
http://www.phpbb.com/community/viewtopic.php?f=71&t=735215

On a note: I'd have no objections to doing a direct insert to MySQL if that'd be easier if someone could point me in the proper direction as to which files I'd need to be sure to include to get all the Nuke CMS contants etc.

Thanks!!
View user's profile Send private message
PostPosted: Wed Feb 27, 2008 10:21 am Reply with quote
Evaders99
Resource Master
Resource Master
 
Joined: May 25, 2004
Posts: 1796




My guess is that this no longer works due to the "sid" parameter being passed. This is set for all forms so that automated processes can't post to your forums. You'd have to read this value somewhere before sending the cURL POST.

_________________
- Star Wars Rebellion Network - Evaders Squadron Coding -

Need help? Nuke Patched Core, Coding Services, Webmaster Services
View user's profile Send private message Visit poster's website AIM Address
PostPosted: Wed Feb 27, 2008 10:29 am Reply with quote
Loper
Resource Seeker
Resource Seeker
 
Joined: Feb 21, 2008
Posts: 10




Thanks! I'll look into that for sure. Do you know if this value is accessible to PHP out of the environment (such as $_POST['sid'])? or will I need to perform a phpBB login first (there is actually a function for that as well, but I didn't want to inadvertently start a new session to avoid server load if this wasn't required) and use that connection.

Really, the goal here is to try to be as "integrated" as possible, so I'm trying really hard to avoid direct SQL inserts and instead use the Nuke API, and this is all from the same site with a logged-in user, not a remote call as the class was originally intended to be used for.
View user's profile Send private message
PostPosted: Wed Feb 27, 2008 3:49 pm Reply with quote
Evaders99
Resource Master
Resource Master
 
Joined: May 25, 2004
Posts: 1796




It is sent as a $_POST['sid'] variable. phpBB assigns a 'sid' for all logged in users as well as guests. However, the forum you are posting to must allow guest posts for this to work. Otherwise your script will have to setup a valid phpBB user session before trying to post.

_________________
- Star Wars Rebellion Network - Evaders Squadron Coding -

Need help? Nuke Patched Core, Coding Services, Webmaster Services
View user's profile Send private message Visit poster's website AIM Address
PostPosted: Thu Feb 28, 2008 8:32 am Reply with quote
Loper
Resource Seeker
Resource Seeker
 
Joined: Feb 21, 2008
Posts: 10




Ok.. after that information and some research of my own, I'm starting to get close. I've decided to re-write the class, based on the existing older version that doesn't pass SID -- at least for now I'm planning that. I may end up with a ground-up re-write that uses a different method other than cURL to pass to the site.

What I've not been able to find, however, is a mostly complete API specification or documentation on the phpBB interface, or at least what it expects. Of course, something that is specific to Nuke would be even better. If anyone has any reference sites or books to recommend, that'd be a great help.

What I've been doing so far is going through some other module code (including Forums) to try to find the session management calls so I can reuse code rather than re-inventing the wheel, if possible, by including those files.
View user's profile Send private message
PostPosted: Wed Aug 20, 2008 2:58 pm Reply with quote
Loper
Resource Seeker
Resource Seeker
 
Joined: Feb 21, 2008
Posts: 10




Ok.. put this down for a while and picked it back up a couple days ago. Still no love.

What I'd like, if someone has a link or some advice, is some how-to on how to initiate or tap into an existing session of PHP-Nuke so I could gain access to things like the user's ID, sid, etc. And what those variables are.. I did look a bit at some of the source for Nuke and played with some (such as the $user variable seems to be the SID, but simply passing it as $_POST['sid'] did not work.

Of course, I could be over-thinking this. Most recently, the problem I've had is I pass everything I think I need and all it does is send me to the normal "New Topic" form rather than insert the topic for me. Again, I'm pretty sure this is because I'm not using the posting.php API correctly.

What I'm thinking now is that I could "manually" insert what I need into the database, but in order to do that correctly/safely I'll need to know how to access certain Nuke internals, such as the current userid (numberic) as well as understand how the post ids are generated (although I expect this last is an incremented value).

Any help would be welcome!

EDIT:
If anyone wants to see the code I've got let me know. It's got a lot of HTML in it so I can't post, even in a code block. It's broken, of course, so not that huge a deal. But if interested I could mail it to someone (drop me a line at sirloper at gmail dot com.
View user's profile Send private message
hello
PostPosted: Sat May 08, 2010 6:25 am Reply with quote
juliamat
Resource Seeker
Resource Seeker
 
Joined: May 08, 2010
Posts: 3




Bacteria originate from faecal matter and pollute streams and groundwater. Most bacteria are only 1 micrometer in diameter, but some bacteria range in size from 0.1 to 10 micrometers. Bacteria of the coliform group are considered the primary indicators of fecal contamination and are often used to assess water quality. Coliform is used to describe a group of Gram-negative, facultative, anaerobic, rod-shaped, get complete information mcts practice tests
View user's profile Send private message
sghs
PostPosted: Thu Jun 10, 2010 5:37 am Reply with quote
huiru
Resource Seeker
Resource Seeker
 
Joined: Jun 09, 2010
Posts: 7




Many people dislike to wash the dishes, and I particularly like washing the dishes. On one hand, see a bunch of oily dirty dishes were gradually washed very rewarding, on the other hand, the side of the bowl to wash hands while brains have all kinds of daydream, like daydreaming. Introduce the current way. In a foreign work before the last seven years, financial crises affect in Shanghai, was sent. When the land held ambitious start their own business, but a few months, now also very hard down the road in the dark. But every day and wife still very happy, happy family gave me the courage and the strength to fight.


覧覧覧覧覧覧覧

fake louis vuitton|links of london charms|tiffany rings|chanel handbags
View user's profile Send private message
PostPosted: Tue Jul 12, 2011 4:50 am Reply with quote
Chunnetter
Resource Seeker
Resource Seeker
 
Joined: Jul 12, 2011
Posts: 5




good stuff !!!
I could be over-thinking this. Most recently, the problem I've had is I pass everything I think I need and all it does is send me to the normal "New Topic" form rather than insert the topic for me. Again, I'm pretty sure this is because I'm not using the posting.php API correctly.
Microsoft Office 2007 Onlineoutlook 2010Office Pro 2010
View user's profile Send private message
thanks
PostPosted: Tue Sep 06, 2011 6:01 am Reply with quote
thomaswinter
Resource Seeker
Resource Seeker
 
Joined: Sep 06, 2011
Posts: 4




good post.
View user's profile Send private message
Posting to phpBB (PHP-Nuke integration version) from a Form
 NukeResources Forum Index -> Random Thoughts
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 4 Hours  
Page 1 of 1  

  
  
 Post new topic  Reply to topic     



Powered by phpBB © 2001-2005 phpBB Group.     Theme created by Vjacheslav Trushkin.
There have been 113 unique hit(s) in the past 24 hours.
Forums ©
Nuke Sites Link Directory


Best viewed with a Browser
All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest ゥ 2001 - 2007 by NukeResources.com
You can syndicate our news using the file .backend.php or ultramode.txt
PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.73 Seconds

:: Eos phpbb2 style by Cyberalien :: PHP-Nuke theme by www.nukemods.com ::