[Nulled] » Nulled Warez Scripts » Forums scripts » Discuz! script » Discuz! X2.5 Add a custom data call module (simple method
November 16 2022

Discuz! X2.5 Add a custom data call module (simple method

Discuz! X2.5 Add a custom data call module (simple method)

Turn: http://521-wf.com/archives/46.html
Discuz! X2.5 Add a custom data call module (simple method)
Function Discuz! The X Series Dista is still pretty good. In the process of secondary development, you can add a new data call module to develop the functional module that you are developing, you can display the data that you want to display in each place of each page.

Below is a brief introduction to the latest version of X2.5:
This can be roughly divided into the following three steps:
1. Add a data call program
2. Cache classification of DIY modules
3. Add the appropriate data template

The specific operation is as follows:
1. Add a data call program
1> New folders in the source/class/block/directory
2>
In the news folder, create a new one Blockclass.php , the content is as follows:

<?php
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
$blockclass = array(
'name' => lang('blockclass', 'blockclass_resource'),
);
?>
Then create a new one in the news folder block_news.php , the content is as follows:

<?php
if(!defined('IN_DISCUZ')) {
	exit('Access Denied');
}
 
class block_news extends discuz_block {
	
	public $setting = array();

public function block_news() {
$ this-> setting = array (.........); // initialize the setup here
}
	
	public function name() {
// Set the data source here
		return lang('blockclass', 'blockclass_news_script_news');
	}
	
	public function blockclass() {
// Set the type of the call module here
		return array('news', lang('blockclass', 'blockclass_news'));
	}
	
	public function fields() {
$ Fields = array (.........); // Set the fields here. With the exception of variables supported by the disk itself, only the fields set here can be called in the template.
                return $fields;
	}
	
	public function getsetting() {
		return $this->setting;
	}
 
	public function getdata($style, $parameter) {
		 $ list = array (.........); // from the actual situation, from the actual situation, the relevant data can be
                return array('html' => ", 'data' => $list);
}
}

?>
Lang (....) in the above code, this is the language processing that is skipped here. There are also settings $, $Fields, list formats $. You can refer to the format of the corresponding variable in Source/Class/Block/Member/Block_member.php .

Secondly, enter the background-lifting cache, be sure to check the "DIY Module Classification Cache", and then start updating.

Third, enter the background portal module template, add the appropriate template to this.




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 12:44
  • Publication category(s): Discuz! script»,Modules Discuz!
  • Number of views of the publication: 191
  • Number of comments to the publication: 0

Related News

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
16 November 2022
Discuz! script»,Modules Discuz!
Discuz Add a Custom Data

First add data calls Second, source/language/block/directory new module module template Source / language /

Read more
16 November 2022
Discuz! script»,Modules Discuz!
discuz code

discuz code the diskuz method Registration method runlog()

Read more
16 November 2022
Discuz! script»,Modules Discuz!
using discuz

Discuz is an open source software, we use this software to manage the forum, we will briefly present the

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

Information

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

Site Search

Site Menu


☑ Websites Scripts

Calendar

«    December 2024    »
MonTueWedThuFriSatSun
 1
2345678
9101112131415
16171819202122
23242526272829
3031 

Advertisement

Survey on the website

Evaluate the work of the site
 

Statistics

  • +8 Total articles 6749
  • +19 Comments 4218
  • +26 Users : 6013