Summary of common problems modification methods in DEDECMS _php skills

Source: Internet
Author: User
Tags md5 encryption php and
Novice FAQ, which I posted earlier, in the 3.1 official edition. Some issues have been corrected, but can still be used as a reference for modification or learning
Please take a bit of patience to finish this, many people have encountered these problems. Why should I keep posting my questions?
In addition, read this please go to your own backstage to read the template tag Reference!! Especially arclist the parameter description of this tag!!
Think more about the problem, more test marks, and learn is their own, not learn, who can not help you!!
Add a little. Many tags can refer to the system default template and template area of some good templates, look at the tag to understand the use of each tag,
Below if there is your post. Thank you for Dede's Utapau Reef freeze.
3.1lit the latest version when the first column for the final list column, so that the list to display their subordinate columns of the article changes
include/inc_arclist_view.php
80 lines:
$addSql. = "and (typeid= '". $this->typeid. "' or typeid2= '. $this->typeid." ");
Change to:
Added to solve the problem where the parent list does not call out the subordinate list
$ssid = Typegetsunid ($this->typeid, $this->dsql);
$ssid 2 = str_replace (' typeid ', ' Typeid2 ', $ssid);
End of Added
$addSql. = "and (typeid= '". $this->typeid. "' or". $ssid. "or typeid2=". $this->typeid. "' or". $ssid 2. ") ";/This sentence has also been modified
The above section is used to solve the paging problem
include/inc/inc_fun_spgetarclist.php
Start with Line 70:
if ($ridnum >1) {
$tpsql = "";
for ($i =0; $i < $ridnum; $i + +) {
if ($tpsql = = "") $tpsql. = "and". Typegetsunid ($reids [$i], $dsql, ' arc ');
else $tpsql. = "Or". Typegetsunid ($reids [$i], $dsql, ' arc ');
}
$tpsql. = ")";
$orwhere. = $tpsql;
Unset ($tpsql);
}
else{
$orwhere. = "and". Typegetsunid ($typeid, $dsql, ' arc ');
}
Change to:
if ($ridnum >1) {
$tpsql = "";
for ($i =0; $i < $ridnum; $i + +) {
if ($tpsql = = "") {
Start modifying the article second column call question
$ssid = Typegetsunid ($reids [$i], $dsql, ' arc ');
$ssid 2 = str_replace (' typeid ', ' Typeid2 ', $ssid);
$tpsql. = "and (". $ssid. "or". $ssid 2;}
else {
$tpsql. = "Or". Typegetsunid ($reids [$i], $dsql, ' arc ');
$tpsql. = Str_replace (' typeid ', ' Typeid2 ', $tpsql);}
}
$tpsql. = ")";
$orwhere. = $tpsql;
Unset ($tpsql);
}
else{
$ssid = Typegetsunid ($typeid, $dsql, ' arc ');
$ssid 2 = str_replace (' typeid ', ' Typeid2 ', $ssid);
$orwhere. = "and (". $ssid. "or". $ssid 2. ")"; /End Modify Article second column call question
}
This section is used to solve the problem of calling subordinate column articles list
Replaced code I write very rough, can be used for a while, and so the official solution after the replacement
In the include/inc_arclist_view.php also to change a place:
Get a single-column List of documents
Under
Condition of Category ID
$orwhere. = "and (#@__archives.typeid= '". $this->typeid. "' or #@__archives.typeid2= '. $this->typeid." ");
To
Condition of Category ID
$ssid = Typegetsunid ($this->typeid, $this->dsql);
$orwhere. = "and (#@__archives.typeid= '". $this->typeid. "or". $ssid. "or #@__archives.typeid2=". $this->typeid ."') ";
Otherwise there is no list content on the page because 80 rows are select COUNT (*) ...
About the column path has a {Cmspath}
First say the meaning of {Cmspath}, open the background "system configuration parameters" can see the second item, DEDECMS installation directory:
This is the path that {cmspath} resolves.
If the Beta2 upgrade to lit, you need to manually modify the column properties, remove {Cmspath}. Or you run all the files in lit after the setup upgrade is done
Replace all previous B2 files so that {Cmspath} can be parsed into your site path correctly
If you do not use {Cmspath} This parameter, you can follow the following modifications
Executes sql:update Dede_arctype set Typedir=replace (Typeidr, ' {cmspath} ', ');
To remove the {Cmspath} in the database
Then modify the file catalog_add.php find $true _typedir = Str_replace ("{Cmspath}", $cfg _cmspath, $typedir);
Change into
$true _typedir = Str_replace ("", $cfg _cmspath, $typedir);
Just fine.
[Field:description/] How does this label limit the number of words?
[Field:description function= ' Cn_substr (@me, 80) '/]
All the tags in Dede support this use of functions
About the 3.1 version of the link after adding the first page does not show the problem
The main reason for this is that BLT the value of the Ischeck of the table Dede_flink when it was written.
In 3.01. Ischeck=1 for home page links. 2 represents the Inner page link, but 3.1 is the opposite,
The best way to change is to open inc_fun_spgetfriendlink.php.
Find Line 13th ...
CODE:
$wsql = "where ischeck=1";
[Copy to Clipboard]
It's OK to change the 1 to 2.
11.11 after the update, the call to inc_fun_spgetfriendlink.php this file was canceled.
So you just need to open inc_arcpart_view.php.
In the vicinity of line 410
CODE:
$wsql = "where ischeck=1";
if ($type = = "P_w_picpath") $wsql. = "and logo<> '";
else if ($type = = "text") $wsql. = "and logo= '";
else $wsql. = "";
[Copy to Clipboard]
Also, change the where ischeck=1 to 2
3.1LIT version of the advertisement name modified after the invalid solution
http://bbs.dedecms.com/read.php?tid=7135
Look at the 4 floor of the replies.
Dede how to get rid of the list of articles summary
Delete [field:info/]
About the background login verification code style changes
http://bbs.dedecms.com/read.php?tid=6244
When the length of English in the article description is greater than the width of the table, it will be difficult to see
[Field:textlink/]
To
<a href= ' [field:arcurl/] ' >[field:title function= ' Cn_substr (@me,) '/]</a>
New channel Model Tutorial
http://bbs.dedecms.com/read.php?tid=5972
DEDECMS Implementation List page double style
<table width= ' 100%>
{dede:list type= ' full '}
<tr>
<td class= ' [Field:id function= ' Magicvar ("Arch2", "ARCH2") '/] ' ><b>[field:typelink/] [Field:textlink/] </b> click: [Field:click/] ([Field:stime/]) </td>
</tr>
{/dede:list}
</table>
I want to implement a feature that is in the article List (template list_article) if the article has a thumbnail to show the thumbnail, if not, then directly display the list of articles without displaying "no thumbnails" picture.
The extension of Dedecms is in function form, because if you add an if this structure is too resource-intensive, you can do this if you need to:
[Field:picname function= "getmypic (' @me ')"/]
Define a function in the inc_functions.php
function Getmypic ($img)
{
if ($img = = "") return "";
else return "}
To handle this.
This may be a bit inconvenient, but the benefit is to achieve the extension of the purpose, without consuming too much resources, without affecting the template structure, the implementation of real template and code separation
Click on the picture to go to the next page
Open include/inc_archives_view.php
About 444 lines around, find
$this->fields[$this->splitpagefield]= $this->fields[$this->splitpagefield];
Comment out, change to
$this->fields[$this->splitpagefield]= $this->clickpicnext ($this->fields[$this->splitpagefield]);
Then, finally add the function, notice inside the last bracket!
Replace the picture with a link
//----------------------------
Function Clickpicnext (& $body)
{
if ($this->nowpage!= $this->totalpage) {
$lPage = $this->nowpage+1;
$body =preg_replace ("/<" (img| IMG) (. *) (src| SRC) =[\ "| ' |] {0,} ((. *) >)/isu "," <a href= ' ". $this->namefirst." _ ". $lPage.". $this->shortname. "' > "." \${0} "." </a> ", $body);
$body = "<a href= '". $this->namefirst. " _ ". $lPage.". $this->shortname. "' > ". $body." </a> ";
}else{
if ($this->getnext ()) {
$body =preg_replace ("/<" (img| IMG) (. *) (src| SRC) =[\ "| ' |] {0,} ((. *) >)/isu "," <a href= ' ". $this->getnext ()." ' > "." \${0} "." </a> ", $body);
$body = "<a href= '". $this->getnext (). "' > ". $body." </a> ";
}
}
return $body;
}
Automatically replace the picture in the article with the next page of the link, if the last page, for the next!
Note: First of all, according to the following changes to the next article on a separate line!
[dede3.1] [Modified] The next one is called separately and limits the article in the column instead of the current full station.
http://bbs.dedecms.com/read.php?tid=5051
In the article list, some of the headings are truncated, what kind of code to let the mouse on the above can display the full file name?
{dede:arclist row=16 orderby=pubdate col=1 typeid=3}
<li> <a href= "[Field:arcurl/]" title = "[field:title/]" >[field:title function= "cn_substr (' @me ',)"/]</a> </li>
{/dede:arclist}
How to display the article column in front of the article name?
{dede:arclist row=10 orderby=pubdate}
· [field:typelink/] [field:textlink/]<br/>
{/dede:arclist}
The generated article filename can increase MD5 encryption
Change your own, this is a typical boring demand bar
include/inc_channel_unit_functions.php
.
[Field:writer/] How could it not be useful
Lit version inc_arcpart_view.php does not read additional tables
Modify include\inc\inc_fun_spgetarclist.php line 120th, add Arc.writer in the back,
Of course, you can also add additional table content that you would like to introduce:
Arc.writer,arc.source,arc.shorttitle,
Newly installed DEDECMS3.0.1, the first landing on the said I password wrong!
You have to check if there is a dede_admin this table, if there is, to see if there is data,
If the username and password do not have an impermissible symbol,
Typically, the server may not be able to complete an installed SQL import to prompt for a user name that does not exist
It's OK to add a user by hand.
You can also delete the table dede_admin in the database, and then reinstall it
About Listpage paging in the build there will be a table modification
Search
Get a static paging list
In the following lines you can see some of the pagination
Questions about the multi-style of columns and the model of the bottom of the system
With Arclist
{Dede:arclist
Typeid= ' row= ' col= ' titlelen= '
infolen= ' imgwidth= ' imgheight= ' listtype= ' orderby= ' keyword= '}
Custom style template (innertext)//Here defines the style you are displaying. Do not modify the underlying template ... Lest you trouble yourself.
{/dede:arclist}
The other column template can not use the system default {style}/list_article.htm
You can manually specify the section cover template or list template. Columns such as: {style}/list_class1.htm
{style}/list_class2.htm
And so on. So you can have a lot of style.
Thinking of using Dedecms to do novel station
1. New Two models
Book model and chapter model
2. Re-write the file release program, the key to the two models associated, and now provide the content model of the Cmsware and Dede are not able to do, and Dede from the build channel provided by the file release program can be well utilized. Re-click on these four files (two interfaces and two post-processing programs).
3, if you want to make the beginning of the Chinese network which mode, that is to write in the Member directory on the submission of the program, as well as in the plus write business models such as billing, counting points and other functions of the program.
In fact, Dede is just a content release framework, the provision of background tools only for administrators, users can customize a variety of models, but to dede familiar with a bit.
Can write a program may wish to try.
Why my custom tags are always exported as text
tag to add ismake= ' yes ' property
Some thoughts on the picture SEO,
<a href= ' [field:arcurl/] ' ></a>
Refer to the description of the arclist tag,
Dede editor problem. Errors copied from Word
After the copy of the toolbar on the lower right corner of the yellow t paste button ~ ~ ~ Move up a hint, no format paste
Where is the definition of the label?
All the files in include, what ***view.php are the control view
Questions about Automatic paging
The automatic paging size is only before 2-5
3 is the meaning of each paging to 3K.
This easy to move is not the same, moving easy is the byte, so you can write 2000 or 3000 Dede is k so, you can write 2 or 3, my mistake in, I wrote 2000k! Khan One,
What this means in Dede is that a paging is allowed to 2M! Naturally not successful
About pagination Headers
The content can be formatted as follows:
Paging title 1#e#
1th page Content
#p # Paging Title 2#e#
2nd page Content
#p # Paging Title 3#e#
3rd page Content
#p # Paging Title 4#e#
4th page Content






Additional options: Download remote pictures and resources how to close ah???
Found in dede/article_add.php and article_edit.php (if other models find the corresponding add and modify files)
&LT;TD width= > Additional Options:</td>
<td> <input name= "remote" type= "checkbox" class= "NP" id= "remote" value= "1" checked>
Downloading remote pictures and resources
Change value to 0 delete checked
3.1b2///channelartlist and Arclist Bug temporary Solutions
Fix all column lists are the same and channelartlist under Arclist labels cannot be customized
Open include/inc_arcpart_view.php
Found in line 207.
else $typeid = 0;
and cut him out.
---------------------
Open include/inc/inc_fun_spgetchannellist.php again.
On line 66th, find
$ctag->getatt (' innertext ')
To
$ctag->getinnertext ()
Can.
If there is a problem, you can add the group: 18176791
I can see here. It means you really do stand!!

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.