-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlistofpages.cfm
More file actions
50 lines (43 loc) · 2.93 KB
/
listofpages.cfm
File metadata and controls
50 lines (43 loc) · 2.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<cfparam name="form.q" default="" />
<cfparam name="form.pagenum" default="1" />
<cfparam name="form.categorynum" default="" />
<cfif isdefined("form.q") and form.q neq "">
<cfset qry = model("wp_post").findAll(select="id,post_name, post_title, post_excerpt, post_content,categoryid", where="post_title like '%#form.q#%'")>
<cfelse>
<cfif isdefined("form.categorynum") and form.categorynum neq "">
<cfset sqlwhere = "post_status='publish' AND categoryid = #form.categorynum#" />
<cfelse>
<cfset sqlwhere = "post_status='publish' " />
</cfif>
<cfset qry = model("wp_post").findAll(select="id,post_name, post_title, post_excerpt, post_content,categoryid", where="#sqlwhere#", page=#form.pagenum#, perPage=20, order="ID DESC")>
</cfif>
<cfset qryCategory = model("category").findAll(select="id,categoryname", order="categoryname ASC")>
<cfoutput query="qry">
<tr id="tr#id#">
<td><h2 id="@#post_name#" contenteditable="true">#Ucase(post_title)#</h2></td>
</td>
<td>
<div class="form-group">
<select class="form-control" id="selectCategory#id#" onchange="updateCat(#id#)">
<cfloop query="qryCategory">
<option value="#id#" <cfif qryCategory.id eq qry.categoryid>selected</cfif> >#categoryname#</option>
</cfloop>
</select>
</div>
</td>
<td class="text-nowrap">
<button type="button" class="btn white-btn" data-toggle="tooltip" data-original-title="Clone" onclick="javascript:duplicate('#id#','#post_name#')">
<i class="fa fa-files-o" aria-hidden="true"></i>
</button>
<button type="button" class="btn white-btn" data-toggle="tooltip" data-original-title="Edit" onclick="javascript:editme('#id#','#post_name#')">
<i class="fa fa-wrench" aria-hidden="true"></i>
</button>
<button type="button" id="btn#id#" class="btn white-btn remove" data-toggle="modal" data-target="##examplePositionCenter" data-productid="#id#" data-pagename="#post_name#" data-original-title="Delete">
<i class="fa fa-times" aria-hidden="true"></i>
</button>
<button type="button" class="btn white-btn" data-toggle="tooltip" data-original-title="View">
<a href="../../index.cfm/page/article/#post_name#"><i class="fa fa-eye" aria-hidden="true"></i></a>
</button>
</td>
</tr>
</cfoutput>