<Br/> April 1, October 29: <br/> morning: <br/> the paging and background management functions are completed with Zhao Jian. </P> <p> Zhao Jian proposed to provide the Administrator with a special navigation bar called navout. TPL: log on to the user nav. TPL, the administrator should also have a navadmin. TPL. <Br/> here we will study how the navigation bar is added </P> <p> continue to study how to add our system to the page, I don't think paging can be taken into account in this architecture. You can decide where else there is paging function or idea. </P> <p> Zhao Jian created a homepage editing table for me. The Code is as follows: <br/> Create Table pagecontent <br/> (ID int auto_increament not null primary key, <br/> page varchar (30), <br/> content text <br/>) </P> <p> Add a field to the user table. The Code is as follows: <br/> alter table Users Add action varchar (10) default 'activate' <br/> (deactivate/activate) <br/> added successfully </P> <p> imitating the openness and injustice of books </P> <p> Zhao Jian places the paging function in yzlib's YZ. PHP file, and notified me, I will call it later. </P> <p> I found the pubbooks method in the userhelper. Class. php file, but I forgot to write it for that AJAX request. This method should be in bookhelper, so here is redundant. </P> <p> Add method in userhelper. class. PHP: <br/> Public Function activeuser ($ userid) {<br/> $ SQL = "Update users set action = 'activate' where action <> 'activate' and userid = ". $ userid; <br/> return Dal: Update ($ SQL); <br/>}< br/> Public Function deactivate ($ userid) {<br/> $ SQL = "Update users set action = 'activate' where action <> 'activate' and userid = ". $ userid; <br/> return Dal: Update ($ SQL); <br/>}< br /> You can spell the SQL statement according to the PHP Code as follows: <br/> Update users set action = 'activate' where action <> 'activate' and userid = 22 <br/> Update users set action = 'activate' where action <>' activate 'and userid = 22 <br/> the test is successful, the user locks and unlocks functions, but how does the permission judgment proceed? <Br/> learn how to judge elseif of smarty <br/> {if $ name EQ 'fred '} <br/> welcome sir. <br/> {elseif $ name EQ 'wilm'} <br/> welcome M' am. <br/> {else} <br/> welcome, whatever you are. <br/>{/ if} <br/> in head. the following code is added to the TPL file to ensure Administrator Logon: <br/> {if $ isadmin> 0} <br/> {include file = "navadmin. TPL "}< br/>{ elseif $ userid> 0 }< br/> {include file =" nav. TPL "}< br/> {else} <br/> {include file =" navout. TPL "}< br/>{/ if} <br/> the navigation bar connection is supported. A little more, but you only need to make some changes to the content. The Administrator has all permissions. This is for sure. <Br/> morning: <br/> after adding available and disabled users, you must consider how to implement the feature. Users cannot log on after being disabled, information cannot be retrieved by other users. <Br/> if a user cannot log on, he or she can perform judgment and verification during logon. This solution means that if the user is determined to be disabled, the session token will not be issued to prevent the user from successfully logging on. </P> <p> How can someone else not find a disabled user? This requires judgment during the search, so the business logic here is complicated. </P> <p> I didn't know what to think. In basepage, I defined two methods to set the session. In fact, the isadmin has different judgments and the write-down is: 1 or 0. <Br/> the value here should be a value from an attribute in the queried user object. After modification, the test is successful. </P> <p> index is responsible for the logon task, and another login. Class. php can also be used for logon, but it has never been used. </P> <p> the following error indicates that no modification was made yesterday. </P> <p> debugging logic: <br/> there was no idea yesterday, but Zhao Jian was able to handle it easily. I admire it and think about it: Why? What does he think? Recalling his practice yesterday, but it is useless and there is no substantial progress. </P> <p> Summary by yourself, try to find out your own Ajax debugging ideas, habits, methods, or other things. <Br/> In my opinion, the best way is to use alert to obtain the data called by ajax to check whether it is legal. <Br/> Update books set ispublic = 1 where issafety <> 1 and ispublic <> 1 <br/> now: <br/> check what the website is doing, <br/> when you click the write button, an error is reported because the backgroundmusic table does not exist. I wonder if my version is too old. <Br/> In the booklist, the variable _ iswrite does not know where it comes from. <br/> here is the key to determining whether the user is editing: var srcw.'biography.html? Bid = '+ bookid + (_ iswrite> 0? '& W = 1': ''); <br/> If _ iswrite> 0, add a W = 1 in the URL, if the PHP class in the background gets W = 1, it will compile or execute the user to edit the biography <br/> In mybooks, ondisplay registers JS Code to the page, where the value of _ iswrite is changed, if the conditions are met, the value of _ iswrite is changed to 1. <Br/> How can I enter mybooks and change its value? Click the nav. TPL navigation bar that appears after logon. The write hyperlink calls the onwrite (0) method. <br/> the link address in onwrite is: Too Many location.hrefw.'mybooks.html? W = 1'; W = 1 is written here, that is, this is the key to editing. Click it to edit it. <Br/> however, you have logged on as a prerequisite. <Br/> that is: If you click the write button first, and then click the cover of a book to call onlistclick, Src will not just be: biography.html? What is biography.html? Bid = 11 & W = 1 <br/> because var src1_'biography.html? Bid = '+ bookid + (_ iswrite> 0? '& W = 1': ''); (_ iswrite> 0? '& W = 1': '') the final value will be & W = 1 rather than'', and an empty string. <Br/> the page is compiled by biographyread. TPL, that is, you can only read the content. <Br/> -------------- insert a segment: pagenow = pagenow | 1; this method is found in biographyread. TPL, which is equivalent to the three-wood operator. We should have hope for paging. <Br/> I have commented out the line 123rd in bookhelper to query the background music. </P> <p> loadpage Params. leftpageno = 0 bookhelper.html? A = getrecording & id = 10 <br/> test whether UAB has any errors </P> <p> http://uabdev.51vip.biz/Index.html </P> <p> when no login, click boolist to view the book. You can obtain the class table of the book. However, when you click a letter, a JS error will be reported, Row 3. The code is: <br/> var paramspolicyz.xmlhttp.syncrequest('backgroundmusic.html? Act = loadmusic & pageid = '+ pageid +' & bookid = '+ _ bookid); <br/> I have no backgroundmusic table here, the permissions of the backgroundmusic class in the basepage are not granted. <Br/> the image cannot be normally displayed. It is estimated that it is the class for reading the image. photohelper is called in photoalbum. TPL, and its permissions should also be disclosed here. <Br/> an error occurs when you search for a table in the background. Now, you do not know what a pageid is. </P> <p> the problem is that we do not have a version. </P> <p> evening: <br/> Add a Management Homepage function, combined with fck, fck has been used in this project. It should not be difficult for me to try it. This programmer is a headache for me, but I like it. </P> <p> Add an editindex. Class. php file and an editindex. TPL file to the corresponding directory respectively. <Br/> editindex. TPL imitates editpage. TPL, editindex. class. PHP imitates editpage. class. php </P> <p> in Biography. the Edit button in TPL calls the following function: <br/> function oneditpage (ID) <br/>{< br/> YZ. dialog. show ("editpage.html? Id = "+ id," My life in words-Edit page ", function (r) {If (r> 0) loadpage (ID )}); <br/>}< br/> this function can call up an online editor, which has been encapsulated in yzlib, but I am not very clear about the dependencies. <Br/> Method for receiving data in the background: <br/> trim (Context: $ request-> getstring ("content ")); <br/> the problem is how to call this page. </P> <p> In navadmin. add and click the event editindex on the editindex link in TPL. Code: <br/> function editindex () {YZ. dialog. show ("editpage.html? IID = 1 "," My life in words-create page ", function (r) {If (r> 0) loadpage (r )});} <br/> you can call fck to add a text control format, but you do not know how to set the post object. Here I want to post to eidtindex or editpage <br/>