November 16 2022

discuz

discuz —— , , ( )

The need for:
? ? ? discuz ? ?? Ucenter??? api?????

discuz, Thinkphp32。 Ucenter , 。

discuz :
discuz ( ) :( )
1、 pre_forum_thread: tid ID
2、post pre_forum_post_tableid: pid
3、 pre_forum_post : pid、fid、tid、title、content
4、 pre_forum_forum: 、
5、 pre_forum_thread_moderate: ,
6、 pre_common_member_count:
6 , 5 。

discuz :

Warning! You are not allowed to view this text.


: pre_forum_thread ID、 ID、 、 、 。
: pre_forum_thread ID, ID, tid
: post pre_forum_post_tableid , pid
: pre_forum_post_tableid ID, pid
Part 5: Insert the post -related information in the post pre_FORUM_POST. It should be noted here: PID is PID value in the fourth part, TID is the TID value of the second step in the second step
: pre_forum_forum 、
: pre_common_member_count
:discuz 7 , discuz , 。 , , 。


1. UcApi.class.php
Thinkphp Ucenter

 

/**
           * [SendForumpost One -click Automatic Release Interface Theme]
           * @param [type] $ title [post title]
           * @param [type] $ content [post content]
     * @return [type]       [description]
     */
    public function sendForumPost($title,$content){
                 $ aposematic = 1; / / Public Information, big identifier
                 $ ++ = 112; / / identifier thematic tabs / 112 = notification and notification
        $result = send_forum_post($uid,$title,$content,$forumId);
        return $result;
    }



UcApi.class.php , uc_client client.php

2. Ucenter uc_client client.php
。 UcApi.class.php sendForumPost send_forum_post()。

 
function send_forum_post($uid,$title,$content,$forumId){
	$return = call_user_func(UC_API_FUNC, 'user', 'send_forum', array('title'=>$title,'content'=>$content,'forumId'=>$forumId, 'uid'=>$uid));
	return UC_CONNECT == 'mysql' ? $return : uc_unserialize($return);
}


call_user_func 。

: 。mysql , :uc_api_mysql 、uc_api_post。

: , user.php

: 。 on

Parameter 4: The parameter data passed in the method is an array that needs to be used.

3. Change the UC_CLIENT controller file of the UCENTER client.

function onsend_forum(){
    $this->init_input();
    $title = $this->input('title');
    $content = htmlspecialchars($this->input('content'));
	$forumId = $this->input('forumId');
	$uid = $this->input('uid');
	$time = time();
// start warehouse operation
	 // First step: Insert the section ID, user ID, user name, publication title, publication time, and other information into the pre_forum_thread topic form.
    $this->db->query("INSERT INTO `".UC_DBNAME."`.pre_forum_thread SET fid='$forumId', authorid='$uid', author='admin', subject='$title', dateline='$time', lastpost='$time', lastposter='admin'");  
         // Step 2: Get the data ID of the first PRE_FORUM_THREAD insertion table as the topic ID, i.e. TID
	$tid = $this->db->insert_id();
	 // Step 3: Paste the data into the Post Table Pre_forum_post_tableId. In this table there is only one pid for an independent field.
    $this->db->query("INSERT INTO `".UC_DBNAME."`.pre_forum_post_tableid SET pid=''");
         // Step 4: Get the data ID of the third step in the pre_forum_post_tabled stub-in-table as a PID
	$pid = $this->db->insert_id();
	 // Part 5: Insert the information related to the message in the POST pre_forum_post. This should be noted here: PID is the value of the PID of the fourth part, and TID is the value of the TID of the second step.
    $this->db->query("INSERT INTO `".UC_DBNAME."`.pre_forum_post SET pid='$pid', fid='$forumId', tid='$tid', author='admin', authorid='$uid', subject='$title', dateline='$time', message='$content'");
         // Part 6: pre_forum_forum updates section, related topics, number of posts
	$this->db->query("UPDATE `".UC_DBNAME."`.pre_forum_forum SET posts=posts+1,threads=threads+1 WHERE fid='$forumId'");
         Step 7: Update the user pre_common_member_count
	$this->db->query("UPDATE `".UC_DBNAME."`.pre_common_member_count SET posts=posts+1,threads=threads+1 WHERE uid='$uid'");
    
	return $tid;
 
	// --------------------- 
	 // author: blockchain attack City Lion 
	 // Source: CSDN
// Original: https://blog.csdn.net/weixin_427992222/article/details/908993699 
	 // Copyright Statement: This article is an original article by bloggers. Please attach a link to the blog post for reissue!
}

The database operation of the "Main Job" operation is the seven steps mentioned earlier. If you can't use it directly, you can refer to the link. If you have any questions or where you don't explain, you can comment on the post.

Can be paid for support:

Discuz Forum Server Construction

Other forum content makes data import to the Discuz forum

Discuz Plug -In Development

Information

Visitors who are in the group Guests they can't download files.
Log in to the site under your login and password or if you are a new user go through the process registrations on the website.

Comments:

This publication has no comments yet. You can be the first!

Information the publication:

  • Author of the publication: zews
  • Date of publication: 16 November 2022 13:04
  • Publication category(s): Discuz! script»,Modules Discuz!
  • Number of views of the publication: 2 583
  • Number of comments to the publication: 0

Related News

16 November 2022
Forums scripts»,Discuz! script»,Releases Discuz!
Discuz! X3.4 RUS

Discuz! X3.4 is a relatively new integrated engine from Comsenz (developer Discuz!, uCenter, UCHome, ECShop,

Read more
16 November 2022
Discuz! script»,Releases Discuz!
discuz

Discuz! Introduction Crossday Discuz! Board (Discuz!) is a universal software system of the public forum. Since

Read more
16 November 2022
Discuz! script»,Modules Discuz!
Call the DISCUZ database

define ('apptypeid', 5); // Should, you know define ('curscript', 'userApp'); // Should, you know

Read more
16 November 2022
Discuz! script»,Templates Discuz!
Diskuz -9m

Diskuz -9m ##LI Yang's Discussion Project #### Based on the discuz theme template redesigned by the 9-second

Read more
16 November 2022
Discuz! script»,Modules Discuz!
About the custom html

About the custom html call of the static module discuz x1.5 Tags: HTML PHP In DIY, select module-> display

Read more

Information

Users of 🆅🅸🆂🅸🆃🅾🆁 are not allowed to comment this publication.

Site Search

Site Menu


☑ Websites Scripts

Calendar

«    November 2024    »
MonTueWedThuFriSatSun
 123
45678910
11121314151617
18192021222324
252627282930 

Advertisement

Survey on the website

Evaluate the work of the site
 

Statistics

  • +4 Total articles 6747
  • +16 Comments 4083
  • +29 Users : 5817