Mobile theme Let me on the day into the bucket of gold to share the building site seamless code

Source: Internet
Author: User

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

The day before yesterday began to do a mobile phone theme of the site, observed Dede, wind, dynamic, New Yun, such as CMS system, in fact, do not say so much, I like to use the two: wind and Dede. Dede function There is no need to say more, I believe that people know its strong! But then it was the choice of the wind.

First analysis of the demand bar, mobile phone theme stations of course, involving mobile phone brands and mobile phone models of these two categories, mobile phone brand to make column classification on OK, this no matter the CMS can do. Mobile phone model originally wanted to make mobile phone brand below the level two column, but later found that there was a problem. Because a mobile phone theme can belong to more than one brand mobile phone models, but in the CMS system, a general article can only belong to a column, up to two columns, Dede has a deputy column, but far from enough. Think about theme A also belongs to Nokia mobile phone, Samsung mobile phone, Sony Ericsson mobile phone even more ... So what do we do? Direct use of existing CMS is absolutely impossible to make a good stand.

Only to modify the CMS, do two development, in order to make a better theme station. In the next do not know much about PHP, and Dede too powerful, modified to speed trouble!!! So chose the wind, the wind to do two times to develop.

I have carefully observed the wind news column and thematic structure, although the mobile phone brand can be made into classified columns, and then the mobile phone model to make a special topic, so that a theme article can be subordinate to a number of topics, but could not belong to multiple mobile phone brands, because each subject article can only subordinate a column I think of another way, that is, when the same topic from a number of columns, in other columns to create a new title article, and then point to the first topic article address, this is more troublesome, but only in this way can be associated. See diagram:

Theme Article bisphenol "section A (Nokia)-" feature model 1, Special Model 2, feature Model 3

Title Theme article B (Address point: Theme article a)--"column B (Samsung)-" feature model 1, Special Model 2, feature Model 3.

Note:--the article is from the category

But the problem again appeared, in the release of the article, the choice of topics, the system is called the whole station of all the topics. The effect should be: I'm adding content for Nokia, and I'm calling Nokia's mobile phone-type feature list, not all the models. But the theme of the wind is not related to the column, from here the need to modify the wind system, and then see how I modified it!

First step: Add the Database field, Foosun_data directory has a fs400.mdb, open to find fs_ns_special table, this form is to store wind news topic data, add a field: ClassID.

<tr>

<TD class= "Hback" ><div align= "right" > belong to Classification:</div></td>

<TD class= "Hback" >

<select name= "Newscat" id= "Newscat" >

<option value= "0" selected> Please select category </option>

<%

Set obj_class_rs = server. CreateObject (G_FS_RS)

Obj_class_rs.open "Select Id,classname from Fs_ns_newsclass where reycletf=0", conn,1,3

While not obj_class_rs.eof

%>

<option value= "<%=obj_class_rs (" id ")%>" <% If class_id = obj_class_rs ("id") Then Response.Write "selected"% >><%=obj_class_rs ("ClassName")%></option>

<%

Obj_class_rs.movenext

Wend

Obj_class_rs.close

Set obj_class_rs = Nothing

%>

</select>

</td>

</tr>

Step three: Find the special_save.asp file

Add a property class_id at the end of line 22nd. Line 35th to add code to get submit ClassID

class_id = Nosqlhack (Request. Form ("Newscat")

Last to line 116th add code

Obj_save_rs ("ClassID") = class_id

Adds a category ID to a database record. This topic can be linked to the column. But this is not enough, has not met the requirements, we are to facilitate the addition of articles, can reduce the workload. What else needs to be changed? Oh, of course, add the article ASP file.

Fourth step: In the same directory, find the news_add.asp file.

In the dim place on line 10th, add the tail, ClassID, and add a variable.

Query Statement on line 28th

Getclassadpicinfosql= Select Isadpic,adpicwh,......

Modify to Getclassadpicinfosql= Select Id,isadpic,adpicwh,...... to add a query to the ID.

Then add a line of code under line 30th if not getclassadpicinfors.eof then:

Classid=getclassadpicinfors ("ID") to take the ClassID data out.

Find Line 179th

Will onclick= "selectspecial ();" Modified to Onclick= "selectspecial (<%=ClassID%>);"

This is to pass the ID to the topic List window to filter out other topic information that is not in the column. Go to the 680 line of the file, locate the function selectspecial (), and change the function to:

function Selectspecial (class_id), added class_id parameter passed in.

There is a statement in the function

returnvalue = Openwindow (' Lib/selectspecialframe.asp,400,300,window);

Modified to:

returnvalue = Openwindow (' lib/selectspecialframe.asp?classid= ' +class_id,400,300,window);

Here basically almost finished, although the code is very boring, but how many still have to learn a little, to do a station is very important!

Fifth step: Find selectspecialframe.asp This file in the Admin/news/lib directory.

At the top of the file, insert the following code:

<%

Dim Str_classid

Str_classid = Request ("ClassID")

%>

And then on line 15th

<iframe id= "lablelist" src= "selectspecial.asp" ......></iframe>

To

<iframe id= "lablelist" src= "selectspecial.asp?classid=<%=str_classid%>" ...></iframe>

Transfer parameters.

Step Sixth: Find the selectspecial.asp in the Admin/news/lib directory.

Add the ClassID variable after line 8th Dim defines the variable. Add code on line 10th:

ClassID = Request ("ClassID")

Find query statements near 33 lines

Typesql = "Select Specialcname,specialename from Fs_ns_special where islock=0

Add query criteria later, and the statement becomes:

Typesql = "Select Specialcname,specialename from Fs_ns_special where islock=0 and classid=" & ClassID

It's done! This way into the Nokia mobile phone column to add articles, the fall out of all the models under Nokia, filter out the other models of the brand, it is very cool! This will be easy to wind up the classification of the columns and topics seamless connection.

Article excerpt from: http://www.shouji263.com

This code is for learning reference only, if you need to contact me to source code.

Related Article

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.