How to modify Banner Advertisement code at the top of the Forum

Source: Internet
Author: User
You cannot find the Banner Advertisement code data on the top in index. asp. You can use the method to temporarily delete some codes and view the display result. Check the result step by step to find the banner display code. Later I found the sub main () function in index. asp. The dvbbs. Nav () function in it is used to display the top part of the Forum.

By the way, let's explain the following code:

Dvbbs. Nav ()
Dvbbs. activeonline ()
Getforumtextad (0)
Boardlist ()
Activeonline should be used to count and update the number of online users. getforumtextad is used to obtain text ads at the top of the Forum, and boardlist is used to display the Forum layout list (including text ads, total number of members, and daily posts ).

The banner at the top of the forum should be in dvbbs. as shown in NAV (), continue searching. In index. the nav Function Code cannot be found in ASP. Later, we found that all the sub-functions related to dvbbs should be in dv_clsmain.asp In the INC directory (why is the dynamic network component ?), Nav is no exception. In dv_clsmain.asp, the definition of NAV () is simple:

Public sub NAV ()
Head ()
Showtoptable ()
Istoptable = 1
End sub
In showtoptable (),

......
Tempstr = Replace (tempstr, "{$ top_ads}", forum_ads (0)
......
Response. Write tempstr
......
The guess is related to the banner, but the content source of tempstr is not easy to check. It is estimated that it is related to the database. Open the database and find the banner data in the forum_ads field of the dv_setup table, I am preparing to write an ASP file and use the online modification method to modify this field. Later I thought that since it was a Banner Advertisement, should I provide a modification method in the background of the Forum? When I got to the back end, I was dizzy and there was a very simple place to modify the banner code. I spent more than half an hour waiting for the code to go through a big circle!

After modifying the top advertisement of the Forum in the background, the Forum is displayed correctly, but the location is incorrect. I don't know why. The banner is always displayed in the next line of the Forum Logo, it seems that the banner image is too long to fit in the same line, but it should be able to fit.

Save the HTML of the Forum webpage and open it with FrontPage. It is found that the DIV of the logo is too wide, longer than the width required by the logo, occupying many positions on the top, so the banner cannot display it, to the second line. You just need to set the DIV width of the logo. However, you need to find out where the width is set, and return to showtoptable () in dv_clsmain.asp. Since

Tempstr = Replace (tempstr, "{$ top_ads}", forum_ads (0)

This sentence is to replace the banner flag on the top with the actual banner code. Therefore, the DIV of the banner must exist in tempstr, so it traces the source of tempstr data, which is related to the mainhtml (4) string, continue to trace the mainhtml string, whose data comes from the value of main_style (0). Continue to query and find

Main_style = Replace (Application (cachename & "_ style" cmd.doc umentelement. selectsinglenode ("style [@ ID = '" & skinid & "']/@ main_style "). text, "{$ picurl}", forum_picurl) 'style image path replacement
I cannot check it. This is the source. Unfortunately, I cannot understand it. Is it about the reason for the dynamic network component? But I know it has something to do with style. Open the database and use"

<Div id = "topbar_mid_m"> {$ top_ads} </div>
"Search (this is the banner code in the HTML file, where {$ top_ads} is replaced with the banner Code). Indeed, a lot of code is found in the main_style field in the dv_style table, it looks like the basic style code of the entire forum page. Before displaying the code, you only need to replace the content contained in {} with the content in the forum settings to make the complete HTML.

Therefore, I only need to change "<Div id =" topbar_mid_l ">" to "<Div id =" topbar_mid_l "style =" width: 188px; height: 63px ">" to limit the width of the DIV where the logo image is located to display the banner normally. It is difficult to download the database to modify the file. The file size is more than 500 mb, so it is easy to download and upload files. It is not feasible to use ASP programs to modify the content of this field online in the database, because this field contains too much content, it is almost all the HTML code of the entire forum page, which uses a lot of special symbols such, it is difficult to modify fields using SQL statements. So I thought of how to learn the showtoptable () function, instead of using

Tempstr = Replace (tempstr, "{$ top_ads}", forum_ads (0)

Can I replace the real banner code with the temporary code? I can also replace it. I added a code in row 1218 of dv_clsmain.asp:

Tempstr = Replace (tempstr, "<Div id =" "topbar_mid_l"> "," <Div id = "" topbar_mid_l "" style = "" width: 188px; height: 63px ""> ")
Overwrite the original file in the INC directory of the Forum Uploaded By dv_clsmain.asp. OK. The Forum banner is displayed as normal.

...... It is a hard process to look at other people's program code. It took me more than two hours a night to find some of the code I needed, but I can also learn something from the code, for example, this idea of replacing the HTML string is a good method. Even if the data error in the background of the forum cannot be modified, you can read the error data and modify the code using ASP to present the correct HTML content to the user.

In addition, you can find the loadsetup function in dv_clsmain.asp, which is used to obtain the basic settings data of the Forum.

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.