Summary of developing and transforming image modules for dnn

Source: Internet
Author: User
Tags dnn dotnetnuke

Summary of developing and transforming image modules for dnn

The development of the dnn Transform Image module is based on a series of la S. To sum up, this seemingly simple work.

Because dotnetnuke_04.08.00_starterkit.vsi is installed, the development module is a small case.
Use the dotnetnuke dynamic module in my templates in vs2005 to create a module and remove unnecessary items. A clean module.

Now, the focus is to consider how to transform images.

If you use Asp.net directly, it is said that you cannot change images without refreshing new pages. There are only two ways in front. One is JS and the other is flash.
I have seen this beforeArticleAll of them know. It is done using Js. The specific process is Google's selection of high-quality articles for research. The result shows that javascript can be executed normally on a separate Asp.net page. However, in the dnn module, the Members defined in the document cannot be found.

The first effort was temporarily unavailable, not in vain, because I was still ready for this module, and then I went back to study how to use js to transform the image module in dnn.

Then select the flash mode.

The image storage location and the corresponding link to the website also have three variables for each image's description text (this Flash has five images, all of which are 15 variables ), in addition, there are 18 parameters in length and width of flash and text height. Store these data in a table in the dnn database.

Think about how to do it.

Hands-on ......

Encountered a problem.

One problem is that the column is assigned an initial value when a column is created in an SQL script. I tried it many times and felt that I had not entered an error. I did not respond to the question of why everyone else could.

Finally, I asked on the forum that the premise for the initial value to take effect is to insert or update the data table. The solution is very simple. Add
Insert into Table Name (a column name) Select Value
OK. Solve the problem.

The second problem is that the image location can be the URL of an external website or a local image. Use the URL control of the portal that comes with dnn to obtain the path, but this does not meet my needs.
You need to save the file name as "http: // ip or domain name/directory/file name .jpg.
Because on different websites and servers, the "IP address or domain name" is different.
The same is true for Flash files.
The final solution is:
Image:
Int imgfileid = int32.parse (ctlurl. url. substring (7 ));
Dotnetnuke. Services. filesystem. filecontroller objfilecontroller = new dotnetnuke. Services. filesystem. filecontroller ();
Dotnetnuke. Services. filesystem. fileinfo objimageinfo = objfilecontroller. getfilebyid (imgfileid, portalid );

TB. Text = dotnetnuke. Entities. Portals. portalcontroller. getcurrentportalsettings (). homedirectory + objimageinfo. Folder + objimageinfo. filename;

For Flash files: String swfpath = "http: //" + request. userhostname + request. applicationpath + "/topics topmodules/newsimages/focus.swf ";

Then, create module package is packaged. See http://adefwebserver.com/dotnetnukehelp/dnn_packagemodule/default.htm. Relatively simple.

Another problem is not solved. I decided to temporarily put it aside after a busy day. I will find a clue to solve it in the future and use English instead. I have already posted questions to csdn forums.

Http://topic.csdn.net/u/20080424/10/af02c991-3c37-415b-ba06-75bf5e283a8a.html? Seed = 1191400102

Title: 100 points to the Releaser. Thank you for your support. SQL Server 2005 express and Asp.net have the strange question mark in Chinese. It is probably not a common UTF-8 encoding problem.

In addition, information about how to sell modules is also published on taobao.com.ProgramMembers also need to live. Http://auction1.taobao.com/auction/item_detail-0db2-df657f30851b4b6dd01e9cc9e01920ff.jhtml

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.