|
|

楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////, `7 @! W k I3 S: | G3 d
// Theme Option/ ^- H+ a0 [. {, L+ U" p
////////////////////////////////////////////////////////////////////////////////
& R5 V+ ]8 Q+ N9 P2 ?3 o# C$ O5 ]4 D8 O% s+ s i
$themename = "Zenx";+ ~2 x' g) p. r6 q# H8 X1 a$ ]
$shortname = str_replace(' ', '_', strtolower($themename));
6 g5 X) [7 a8 F9 E) S3 u w) f: u* S! m: s# I) {3 ?
function get_theme_option($option)
7 K% K: f( A) \5 X{0 c2 x: b; w( A F
global $shortname;
& |0 |9 T' e5 L, M5 k1 S% P6 V return stripslashes(get_option($shortname . '_' . $option));
: e# n3 j2 K1 k}) C" l0 y: Z4 Z1 P0 b" ~/ F
! i! e2 v% |% Y( P$ F% q" I
function get_theme_settings($option)
2 Z' C& f2 [5 x4 T& E{/ ^. y7 o# v( E% @0 c0 o
return stripslashes(get_option($option));6 }2 ~' l3 [% t3 Q5 M" S: V& |* T- E
}
9 W4 q& T- q" j6 V$wp_dropdown_rd_admin = $wpdb->get_results("SELECT $wpdb->term_taxonomy.term_id,name,description,count FROM $wpdb->term_taxonomy LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id WHERE parent > -1 AND taxonomy = 'category' AND count != '0' GROUP BY $wpdb->terms.name ORDER by $wpdb->terms.name ASC");7 L7 O* Y: h6 @+ w
$wp_getcat = array();
/ `+ S" c" p* ~' y/ [7 H/ L2 }/ mforeach ($wp_dropdown_rd_admin as $category_list) {$ k7 d( ^; R' o+ h) C: J. D
$wp_getcat[$category_list->term_id] = $category_list->name;
9 O+ m+ C0 S* k) K* K}6 Y0 I9 T6 a9 T: f0 {: F
$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
/ {, Z4 ?/ g) A% Y$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");# m! A* g# Y" ~0 Z8 J: ~
$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");2 l$ h' ~1 A) I5 e
3 T1 U8 A# R: }- n+ I# | ]) S
$options = array (
/ A" ], ^ V$ W# M9 H" F' c& X( r/ E, D1 \" m
- z; S7 h! X" @ array( "name" => "Blog Header Settings",
8 X5 Q1 p5 P1 V5 G2 i& Y "type" => "heading",+ d" J# X& C: b7 }
),4 n, u1 o* w5 B, p- V
5 M& H2 X) s( Q# Z array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",. q% c/ n. P/ @/ x9 n
"id" => $shortname."_header_logo_activate",
3 s! K- J# m+ r: A8 ^ "type" => "select",
' Z+ Y0 k* X# V "std" => "No"," |' S- A# i3 \: W+ U! v+ F
"options" => array("No", "Yes")),: F- {8 k/ @7 c1 [
/ o' i* |+ O; }+ J x' @ array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",
# M4 Z' @- A h2 s _ "id" => $shortname."_logo_url",
) w; h7 l: V; m: a! @5 F. _ "type" => "text",
/ {3 d6 s# h1 s5 I1 y- a "box" => "social",) n) E |! a% ^* b3 P# j" b' |
"std" => "",7 r. H9 R5 Y4 ]( d2 o: O$ u
),
}) N/ H1 x) {0 r2 t 6 R8 X2 W5 z/ [
array( "name" => "Insert Header Banner HTML Code (Header)
; h( V1 x* J8 ]0 r6 J- H <br /><em>*Recommended Size 468 x 60</em>8 t- W/ O6 c; S1 w2 x* t H
<br /><em>*leave blank if not use</em>",3 q9 E8 V& b, J6 ~- [
"id" => $shortname."_header_banner"," P5 }$ Z% H7 t
"type" => "textarea",
& M; q4 D$ w2 M- R "std" => "",) l; `) F* T9 N6 U$ P U
),
, K% d/ p0 }# N7 x4 v" |5 S2 R1 |1 b2 @ e* M
array( "name" => "</div></div>",8 Z j. s$ D; o* W4 e3 U" L
"type" => "close",
4 y8 z* @% b) D ),
" b$ l. m2 U% c4 J3 d3 C% G* h7 h0 D7 S" T7 U
" i6 @/ u9 {: \+ [$ m+ K array( "name" => "Header Navigation Settings",2 h2 B$ V1 A; l# W% d9 _
"type" => "heading",
- q, p* [# C# A3 U( D )," k- W8 U+ p& {& o4 M6 {' N9 q
8 K0 P- J# F" q3 q: F3 O: A array( "name" => "Insert Page ID To Exclude On Header Navigation<br />
' _. W/ {; O) b4 B, i <em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />* a1 C, `+ ]3 p, m
<em>*Enter the page post ID number only</em><br />) V5 I1 `% j+ l, B- P- @
<em>*separate by comma</em><br />
1 j% H6 r$ ?% x1 p- u <em>*Exclude pages which you don't want to show on the header navigation</em>",1 d7 G( N5 H2 V. z3 Q, Y
"id" => $shortname."_header_page_navigation",
5 s7 |. g- k! {% `% F "type" => "text",- i: Y3 E$ H+ `' E% V/ h. ]* m$ ^$ p7 F; ?
"std" => "",0 ]! \0 d0 i4 ]# x$ h. M& {
),
& B% p! Q- o3 |" l1 B( n+ K; e, r7 o3 c9 A; U9 E) C. B- @( g2 F# M
array( "name" => "</div></div>",
" G" l# r" Z5 o+ O "type" => "close",+ d$ }9 a' k0 V. j+ B8 O) j$ ]5 q
),
U0 h0 }) K$ W2 w' ]
9 M+ K2 V$ ?0 r2 B# K& M
4 S- W. w: H3 T( x1 J. f array( "name" => "Post Auto Thumbnails Settings",2 g+ R& F3 x, @% }
"type" => "heading", j9 ^' i) w# q8 x7 J" j R) ~" x
), W- f2 _3 P3 ^% |9 f- R# v1 o) O
! y: u; |" c4 {: \( J
array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
% k% ]/ y. f' _! S0 E7 B "id" => $shortname."_timthumb_activate",
. ]* h8 |' E" b" | "type" => "select",
% c4 I5 F- b. u$ S6 T: [' _ "std" => "No",5 g$ l" b- B, R( L6 g
"options" => array("No", "Yes")),
3 G2 h6 k; f5 ]' r
' H0 h* Q: t# @4 I0 E) i4 B array( "name" => "If Timthumb is enabled, Please choose its cropping method",, W2 s! X4 L! F; c) X4 q4 [
"id" => $shortname."_timthumb_cropping",) ?# ^0 L$ [1 u0 `' w6 `
"type" => "select",# C2 \, \' o; U% u
"std" => "",8 a5 _; o( y* q3 c) K. ~, a I
"options" => $crop_position),
: x7 i; e! z9 N$ u7 _; c. [8 S% ?# E# u- Z" @
array( "name" => "Insert Width Of Thumbnail Image<br />7 k) v6 l% Z$ F* U# `
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />% _2 K7 z* r/ Z0 o* D
<em>*Leave Blank To Use Default: 250</em><br />",4 s2 Y- _& F: {) V. i
"id" => $shortname."_thumb_width",
% L+ V+ P$ u3 R% [7 {# { ]. R "type" => "text",8 R9 m- O+ H2 m3 E1 o6 V
"std" => "",
6 H( W' }7 ?+ P( X6 @# k ),
0 h0 ~) R- U2 P! g s9 Q! n
. q: x6 O# N6 u- t/ ]0 T array( "name" => "Insert Height Of Thumbnail Image<br />( [: _* s! D$ u/ }4 t- ]
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
6 i+ Q0 p: S& @6 e <em>*Leave Blank To Use Default: 200</em><br />",! i* c5 D. h, r
"id" => $shortname."_thumb_height",
W+ c! b' ]: o" F7 ~ "type" => "text",
: C5 C7 n/ V. E; e# | "std" => "",5 X0 o4 P3 A" Y" f
),
% A( Z: h k) D. s5 W( r# @7 `5 e# G8 u' r) V+ M; S
array( "name" => "</div></div>",0 K5 i0 q/ i9 g- ?$ ]5 {1 |
"type" => "close",( L# G9 E4 F+ [0 v0 @# u: l( X
), ?. ]9 }4 e# S) q1 U: v4 N, A1 h' z A/ ?* Y
' ?! ]& q, `; I- n
array( "name" => "Featured Content Slider Settings",
, A' D" }$ a$ B2 x4 d+ b! ^ "type" => "heading",
8 K; v# Q' d' f8 F8 `: H* G ),( O0 S$ i& F% Y
: |6 F6 a6 s3 v
array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",& X3 Z* @; V5 r$ g
"id" => $shortname."_featured_activate",& x5 s% F: I/ y
"type" => "select",# i, _ e: S0 Q% _: d" n
"std" => "No",
( {4 e0 L7 {1 I# m* G+ o "options" => array("No", "Yes")),: U3 A4 B8 W% U, g
8 b: V, F3 Z: n; f5 f7 n; b! O4 p; \5 R( a
array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",- Z% h& B1 ]3 N
"id" => $shortname."_featured_category",: O6 g8 L3 Q* j/ \
"type" => "select",
9 d5 u' i& M& j6 F) r; P: {& }$ q; I "std" => "Choose a category:",% _8 N0 _* ?" X6 Z+ ^
"options" => $wp_getcat),
$ `# T9 A* i4 l% t
5 W# u" R0 A7 X( N9 |4 c% Q1 }; K array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",
5 q2 P2 C y" d( V "id" => $shortname."_featured_number",
5 u* z& i, I$ P$ j& H "type" => "select",$ b+ W1 c& f2 H4 V! q" R
"std" => "Number of post:",
6 ]) C- P$ B6 U- t* \ "options" => $number_entries),4 f. a2 S# y, A3 f' M
0 ]2 z) @" V' D; G array( "name" => "</div></div>",
* L H9 N' K4 F9 K( ~- S3 x "type" => "close",3 b$ {9 a. r' \
),
# s: f9 R& G8 j* v. o' ~
+ z7 {4 P- ~1 w' ]1 a; W- \2 D array( "name" => "Featured Category Settings",
# J; W7 J! Q9 b, P* b/ c" ]# i" S "type" => "heading",
6 o0 h0 E' l) _8 |% T ),9 Y' ]- p# d7 }* m0 [; n
C2 g* K7 f4 G2 K9 @ array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
) Q8 W7 @# N2 k; ?# T+ y4 A "id" => $shortname."_featured_category_activate",
# ?" `5 q9 n- n Y8 ] "type" => "select",
0 X, n. J% n: l: f "std" => "No",: q8 w; o; ^ v, w3 j6 s* F$ J
"options" => array("No", "Yes")),' a, e, f* ^ [6 {, c2 Y
* {, F; Z$ x* T array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",2 S6 ?6 P' M( {6 y
"id" => $shortname."_featured_category_id1",
2 x. f: }2 Q4 c5 Q3 }. [ "type" => "select",
* J0 O, h+ A$ k! u/ E! R* j" f; M "std" => "Choose a category:",: \( H- z6 c$ z: j7 ~+ j, v
"options" => $wp_getcat),0 h, i# D! r. O* h6 P ^/ y+ ~8 ^
( e& E X- d8 c3 q) U
array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",' Z2 y0 l% }* L5 N9 G$ a. D( b
"id" => $shortname."_featured_number1",3 O/ V9 K2 Z, p2 R& `4 h9 Y7 w
"type" => "select",0 j, \4 B Q# ^% v
"std" => "Number of post:",
- R0 t) M2 w3 q# H9 {" I) \ "options" => $number_entries),0 ~; T8 z$ V. N+ f5 m* C
# U7 w: K* {# a# w8 D* I7 N! l array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",, V* e$ U4 Q6 v% p" Z* `- C" J! l4 X
"id" => $shortname."_featured_category_id2",0 ]3 B' L" y% W+ k1 d9 Z; S
"type" => "select",
; {. R! x0 R0 |9 @9 ?7 Y( K/ f' C; [$ l "std" => "Choose a category:",
3 k8 e% O d" }" Q "options" => $wp_getcat),: e% k0 V* a3 T& E
- l/ M3 w x" T( n, o" j
array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
2 D' {8 Y+ O9 K; |8 H9 I" u "id" => $shortname."_featured_number2",
# W$ T, l" H/ ?) N- ?' \ "type" => "select",% U4 P. ?9 {* k% b" w- j
"std" => "Number of post:",, Z6 T J' G1 {! z% ]4 P
"options" => $number_entries),
: `) E# u4 b# J0 J5 g% H
2 K+ n, v5 k) [. R" M8 y
" H9 b5 z: j2 `) f, X. Q+ {) t/ `* b2 n array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
" u1 B, D& R0 D# g "id" => $shortname."_featured_category_id3",# _$ k9 `8 h! A) ]- D) ?
"type" => "select",
& L9 Y6 ?9 H4 O- f "std" => "Choose a category:",2 i8 A, K: f) S$ y- @
"options" => $wp_getcat),
2 P; h4 O% L' L, U! L* q
- N$ n1 @+ m( _ array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
; Y+ B4 I v0 F3 d "id" => $shortname."_featured_number3",
$ u4 z, }$ g. q6 t% e8 Y# }8 A "type" => "select",
: x5 k! H+ G0 D# @ "std" => "Number of post:",2 C. X6 h" w' e, ?$ Z1 z, h0 Y
"options" => $number_entries),
0 R9 r0 x# k' l0 N4 U1 K1 O ^1 |5 k# n
! G( s3 Q. ^# |! ~ array( "name" => "</div></div>",3 Z. O# T& X' I6 w* m
"type" => "close",
5 u7 y8 {/ y/ K ),7 |# p9 S% g! ~/ \, h" o
8 A! J5 D# ?1 a; _& E
; h: _# i$ d! L G+ F6 y; | array( "name" => "Google Adsense & Analytics Settings",
' B! G2 B$ x; C& T8 T& K "type" => "heading",+ K! M4 B3 ~. f5 u6 H/ Y5 ?
)," V8 ^# H0 d' W5 q& M: J8 m
# k. e {' H5 {& {& z+ G* }6 N- d
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",3 M3 U4 y1 L) @: }& V( A
"id" => $shortname."_adsense_loop_activate",
9 q5 o5 a8 \1 P' n3 e! @ "type" => "select",
; `# ~4 u7 c- x7 m4 }' A "std" => "Disable",8 E/ y3 Y5 t$ \: O- t6 p, K
"options" => array("Disable", "Enable")),+ Q* C) i5 \; e2 I
^" f; o# E/ b: ?% {3 r8 C: P' s
array( "name" => "Insert Google Adsense Code For Loops Here<br />
4 i: P$ {$ t2 [& E: V( ^* F4 n <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
6 J$ s# O0 T8 W) V) m0 T1 U& \9 y2 a "id" => $shortname."_adsense_loop",
, }6 L5 X2 t9 {, i$ X# ~ "type" => "textarea",5 R+ f( @) ?; d- q0 `$ b5 j$ P
"std" => "",: [' {8 t- ], o: w% d8 X: k! w. ?
),
- Y) P: B, z- V3 q, S
& @$ v( ~# G1 f* s- G( ^ o, H array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",
& b# b. j* e" e! x "id" => $shortname."_adsense_single_activate",* V4 S! b# i8 |- v+ [5 Z
"type" => "select",
% f% ^) o& B3 r7 E0 J "std" => "Disable",
. S' B" w9 W" ~, e3 M) {1 g "options" => array("Disable", "Enable")),
X, e! m8 B' x# i$ k; L8 T3 u2 W$ \' g4 e# k. ^8 C& Y& O/ L
array( "name" => "Insert Google Adsense Code For Single Page Here<br />
6 {2 d% | u! C <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",$ m0 j! i; j! N6 X# \, q
"id" => $shortname."_adsense_single",
3 I& y0 D' f9 `% r# E# ? "type" => "textarea",
0 Q" U0 E4 i! g% v! [ N. D "std" => "",
, r6 e+ M8 w: I% W ),
+ M X& W( ~ ?4 `5 ?$ f( x1 u6 o' x$ v) f6 v( H: S5 l' I. H
3 N6 h* @; `- V6 F( i
array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",. Q M# j- d( D, D, M
"id" => $shortname."_google_analytics", u( q4 L# d& g. _: f/ U
"type" => "textarea",
+ j, x4 A! S* m8 O# t "std" => "",
4 Z' V5 A- }! ]8 I ),
* m$ V0 u0 _$ h/ |
5 F' s1 o, I+ \& H array( "name" => "</div></div>",
! F9 S: R+ n$ {; `& a "type" => "close",) b' F$ W# t% ^9 N4 t! X. f* R8 {
),
' I8 ?) a# F4 d; y7 t
( Z/ {4 n3 I. G
. n3 y+ _& U& D# U array( "name" => "AddThis Social Bookmarking Settings",2 z: F% x, ~( V, ]/ l* A
"type" => "heading",
/ j2 x) H& m) ~# _5 ~! D ),
0 X8 F5 O- f0 E* O# X$ B6 n2 W$ f+ @% _8 G
array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>: ~7 o1 T, m3 ^6 W2 r6 a, Y
<br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>", A3 g- h. @( F
"id" => $shortname."_addthis",
& C3 m9 X. O$ e: y" _ "type" => "text",
" ?4 h# Q1 e/ i) y5 b "box" => "social",
! J8 x/ F$ o( L+ F- m "std" => "",- O6 l2 r5 }: V: G
),; ]" B3 T2 p5 ]2 h4 }
$ A* n7 z3 p4 i/ `2 Q3 ~. ?& ? array( "name" => "</div></div>",. ?1 R" A( G1 i2 X2 ^; b& L
"type" => "close",
3 M! j/ e! c" Y ),; L. J/ u6 n' D9 q5 v; @
: m! _/ U; l1 ?' E9 J2 k# T, d / O3 K" X+ _. c. t* b: b% j
1 D9 m/ ~4 X# O9 R, g1 t( t" ~ array( "name" => "YouTube Video Settings",8 }, _" y1 e4 T
"type" => "heading",! _2 a. P, {3 V8 q
),
* g% n, x, R/ m# ]( s! e# d9 q. R; c3 N% i) ~& k; _' Y
array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
) K% ]* U5 r3 \. q& S "id" => $shortname."_emvideo_activate",0 q8 e2 H/ ^1 ]& d9 s/ S
"type" => "select",
2 ^3 Y, a1 a' p+ A "std" => "No",& ^2 p& D/ N4 S6 V2 s
"options" => array("No", "Yes")),$ ^/ X/ N9 E4 U
& i0 k: P; A8 @
array( "name" => "Insert YouTube Video Unique Code<br /><em>*You can find videos to embed on <a href=\"http://www.youtube.com\" target=\"_blank\">YouTube</a> site.</em><br /><em>i.e. Youtube - http://www.youtube.com/watch?v=<span class=\"redbold\">Hr0Wv5DJhuk</span></em><br /><em>*Only Insert The Red Bolded Code Inside Below Setting Box.</em>",5 [5 U& e" N6 y9 }
"id" => $shortname."_emvideo",$ _# p/ T) w; C+ T' f, E
"std" => "",
! R% l! M1 Y' M2 Q7 U* o& ~- v "type" => "text"), N# X( u7 e8 K M$ ]# v
8 {; U1 W- _& x, ~4 h, A! ?" w
array( "name" => "</div></div>", Q0 P" k( H l7 c
"type" => "close",+ @+ r9 W9 D* w% \
),
$ n7 Y; N1 S1 g( H) v: X; ? * C" ~1 q# u ?; \; F1 ^+ {0 L
array( "name" => "Twitter Settings",
! ~3 ~" W$ J0 \- o "type" => "heading",
' n: h7 g& H- k0 U, F" n ),& |" _) ~- G- V! |8 S) ?
- e1 Q; X8 Z3 [( G4 M: E; p array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",4 E t$ t! I# l
"id" => $shortname."_twitter_activate",
( m) x8 B% P) s6 [0 T "type" => "select",
" k) T, L4 G* K" P) f( b; J1 ?7 p3 h "std" => "No",
% p2 Z+ n- a) ^2 |, m "options" => array("No", "Yes")),' \- Y! P% S' s2 W
4 ^4 o1 ?( p' X& _6 _ w3 { array( "name" => "Insert Your Twitter ID here7 F: K' D7 W& H: M6 l
<br /><em>*leave blank if not necessary</em>
' S' D/ Q* z1 g+ n <br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",
' _/ D4 N+ Q% m8 |. S" h "id" => $shortname."_twitter",0 N" W1 I- }6 y; Q8 |
"type" => "text",
- l1 ~2 z6 a' R( Z "box" => "social",
5 @4 M* f" _( o9 @9 n "std" => "",* y+ C) f6 D* X. A
),
8 i* q. k( S6 ]
( f4 ?) R2 E! d array( "name" => "Enter Twitter Feed Count here0 ~% U2 A" }. w5 s+ S
<br /><em>*leave blank if not necessary</em>" @$ ~6 M2 t7 n# {. _+ U4 I+ @% m
<br /><em>*Enter How Many Twitter Feed To Display</em>",
& R4 Z7 {5 J p2 z$ ^+ \ "id" => $shortname."_twitter_count",: L0 S9 K0 i/ W- C
"type" => "text",
9 G0 r5 |3 i8 d0 f. A "box" => "social",
# ~! s$ O6 l) D9 H; H4 [& o' |9 W3 z "std" => "",
' K- G% q! J) z6 a5 p6 B ),, d- K5 r+ `6 l2 g* O+ ]+ y
2 a) B* ^% D# \% P* K array( "name" => "</div></div>",! ]" C. X0 ]6 U$ h0 t
"type" => "close",# s7 }$ M' ^. |' M
),/ M# }/ e, z9 H
0 z) B. E2 h0 ~2 @; n
! [% l ?2 p9 Q) L array( "name" => "125 x 125 Banners Advertisement Settings",
4 V9 C7 p2 Q2 n, p "type" => "heading",
9 s1 z- _0 o' {% W ),
, h5 @8 u# [8 Q8 B* u3 ~& P0 S
, W& L2 m4 G7 x: W array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",' _- \" D0 W/ w$ v7 U$ r! m3 c
"id" => $shortname."_sponsor_activate",
. ~1 Y8 L+ V* I5 r8 D5 k( O "type" => "select",# K) I+ o7 `* c) S
"std" => "No",% n: z; l. ~3 [( F, @9 V. p
"options" => array("No", "Yes")),
$ X; t; }; g# P) x! u) C ! n( X. O6 V9 F0 F: w2 Y: S% T R
9 o) m2 ^: S3 _/ | X array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",
, ]3 ~5 e" h' e# x" N "id" => $shortname."_sponsor_banner_one",8 M2 L& i5 |( r0 L% O
"type" => "textarea",: \/ e2 }4 h$ E6 r7 c
"std" => "",
! B- K+ V) P+ c0 } ), 7 [$ I. k" {$ z9 G: J. K- O
8 P+ W; ?9 d# l; Q
array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",
! ~/ C0 L; ~) b3 O* j; k+ A "id" => $shortname."_sponsor_banner_two",
: i3 B0 L( X4 ]# H2 Q* d& d "type" => "textarea",
* t/ @! }4 K" S; J7 Y5 [ "std" => "",
% h p# s9 z) A% ` ),; X* J: Z, b+ @7 ]3 W. E) V
( \* y( \: H2 H3 h6 u array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
& c$ H; b; p+ @ "id" => $shortname."_sponsor_banner_three",9 u+ [9 S1 |/ Z) B
"type" => "textarea",
! N- q8 F c' l, R7 V$ B "std" => "",* |( ]% T* [& g( ]6 F* t$ v
),4 Q; w, s2 ] @5 A. C& L
6 F% z1 k7 k$ B' I% C
array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
7 P$ i+ J5 F# O7 X/ |+ O# w9 J0 s "id" => $shortname."_sponsor_banner_four",
1 p: y# W0 C- w1 d "type" => "textarea",
9 N; I3 v- L/ N0 R- E$ k) }) _ "std" => "",
m$ @) r! C# w$ ]6 j1 @1 r1 ` ),& h5 l6 f+ s! x& p2 M7 q
N: i7 j' ?( u$ Y array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",
# i% q9 L K1 h- t! n/ P "id" => $shortname."_sponsor_banner_five",; t4 F$ k3 X! w. Z) F
"type" => "textarea",3 S8 p+ Q9 H* k+ q2 ]
"std" => "",
. W2 I8 S* v% p6 i0 F, T ),8 l% g. A7 G4 E6 {: h* C
5 R! n; o7 m5 W* ~$ N) s$ k3 C array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",
# S( i: Z" ?: I- I& h( Z. X$ \ "id" => $shortname."_sponsor_banner_six",
& P6 a4 P6 `2 t6 P) D "type" => "textarea",
( m7 c1 D8 I1 G; X! ? "std" => "",
: b$ n+ r$ M2 K9 H! W ),- c& s+ Y+ T' X5 Z) S
" ]9 h. Z4 n8 V$ e# M# n, O array( "name" => "</div></div>",- Z+ S: }9 V% l2 K- ]$ E; p& Z
"type" => "close",' h! ]$ T7 y& X- ^
),5 g* Q, J S/ p! C; ]/ C( t9 z1 x
$ B7 J: M! ]3 {7 k
: |8 x4 L* Q2 o+ X) w* t' ^/ R
0 k- A8 Y- e* c, m4 j- v$ Q' V);
: S1 |1 j1 d, X$ w
3 e+ M2 i6 q7 _1 f% \function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {; W5 w: b* H H% S* R! X
3 j$ [6 S/ l1 @# k8 S
echo "<div id=\"admin-options\"> ";) Q9 V+ i6 S9 P& ^* T- W8 N' K
1 D4 v( i& T) n+ G( A8 x' Pglobal $themename, $shortname, $options;
4 K t8 ?' n) A, e" Q* x7 Pif ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';
3 T9 [$ U4 i g' dif ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';
( a& F9 U* @- f! i7 Z; y?>
! T+ ]1 l" [' M* D3 S+ L* g
* C2 D" F$ ]; ?, u# y: m<h4><?php echo "$themename"; ?> Theme Options</h4>( b$ g3 X6 F7 r! V- ]% g
" h, G+ Y8 d8 _) H0 x) Z
<div class="annouce">4 U# W* @4 G! p0 j( J
<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>
7 [( _3 p' ~* s9 b% z( H" {<p>Don't Forget to <a href="http://feedburner.google.com/fb/a/mailverify?uri=MagPress&loc=en_US" title="MagPress Newsletter" target="_blank" rel="nofollow"><b>Subscribe Our Free NewsLetter</b></a> In Order To Receive Theme's Updates and Fixes.</p>5 s' a8 V1 l5 r$ y7 x
</div>
. n& }0 H/ y/ N' N
& d$ U) j- X$ A<form action="" method="post"> N& A" v6 }2 `% {) l
+ G& [4 p" x- g/ Z4 a<?php foreach ($options as $value) { ?>
8 m6 ^4 U7 I2 X' ^0 J! q; {7 J: j! `( u7 _/ \# e! l& R6 g" r) x; d
<?php switch ( $value['type'] ) { case 'heading': ?>9 s7 e7 R+ Y7 S- P1 L8 j# K U3 t* o
( h) W/ r- p% a- \0 V! y, L<div class="get-option">
! O6 B& Q- A" e4 P; [6 ^! {/ e. C( v. G1 t- X6 I, P( C6 K0 X9 Z
<h2><?php echo $value['name']; ?></h2>6 s, |3 e! p( M, g/ q
: r; W8 m- t: w<div class="option-save">, P: v+ B$ O# n
3 ]( u* K2 [1 r1 X! g0 @& w* c<?php
) a( p+ D- X6 r; Gbreak; }; U4 N; v+ j) z& U
case 'text':
8 T7 n/ \9 p9 P* V& m0 q5 I& \?>6 @( P2 n m9 c/ ]3 V8 I8 |( m3 H! B
: W9 Y8 R/ b( v- H4 u% p' [
<div class="description"><?php echo $value['name']; ?></div>
1 h R& r+ q: ]1 I: N) C<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (# g! ~- ]+ l7 K7 E1 R0 k! c9 k
2 }$ s7 M7 D: ]2 ?5 q7 K
get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>
' N8 s7 \: B$ Y p4 i2 {% J4 }4 k% D
<?php
$ X+ P0 K4 g: O6 |. P: i1 nbreak;
5 u2 w" R% i# b1 g1 P# {- k% bcase 'select':
* j a6 s/ s0 x- ~?>
8 Q) m! G! T. i" m4 s2 z @: E" g1 M8 M" a4 `
<div class="description"><?php echo $value['name']; ?></div>
1 T& ^, H4 p4 u" i: q5 w" Y<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">& u5 ~8 ?) P+ r
<?php foreach ($value['options'] as $option) { ?>
1 V7 G4 i: s0 p<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
+ ?* |5 a+ Q$ O$ L& I<?php } ?>- J) U: x3 T9 K( a. D: H
</select>7 j8 @. Y2 w+ q) m) z
</p>
" ]# A; P& l6 B9 [6 q) e. j$ I8 p: {9 v5 H5 {& B1 x1 ?
<?php
. ` I6 l5 t: D3 O* h1 N/ \% }break;
9 G" T- M9 e# B2 J- q' L2 kcase 'textarea':
/ M, B0 y% B" a" m$valuex = $value['id'];# v/ [% d# Q( m9 U' [
$valuey = stripslashes($valuex);
9 V" r# d% }' i# [) h- j% t; a$video_code = get_settings($valuey);
7 h y9 w' z' y D1 G1 R?>6 v% B' I' B" b
5 v+ ^, E& B7 ~/ _+ n* u1 x
<div class="description"><?php echo $value['name']; ?></div>
) A8 W F( @( _7 y+ i2 K9 b/ n' E<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
! Z4 _- h" ~; ]* ^
% ]! z3 J6 L/ o% i s: velse { echo $value['std']; } ?></textarea></p>
& _0 a- I; ^& A- I( ^0 N C4 o& Y% D6 O1 p1 O
<?php
' s$ ?& @; R/ N P- pbreak;4 h3 z9 n6 E, B# a
case 'close':+ s4 o5 }3 n/ d; D" g4 y
?>% E3 m/ |0 @; p. q
1 D) U8 c7 O7 s7 w5 b0 O6 v
<div class="clearfix"></div>- y3 D) q4 c; x9 ?! ], Y- v
</div><!-- OPTION SAVE END -->+ L! |6 x) Y6 n) Y, i
2 `& z( h2 E# f( }, ] K<div class="clearfix"></div>9 n8 e: @. {4 G! q1 L
</div><!-- GET OPTION END -->0 h/ ]+ D! Z2 a8 Y2 K4 R8 x
- p3 ?& P) v: E9 d3 [
<?php0 F F6 o, X% G9 C3 G" k( M
break;) M; P9 _' M7 A: c0 g) D; [
default;
7 v5 V0 |, y. o( S?>
% R- Q& l1 H& Q
0 a7 O* o% V# i S) c+ v1 p% I% d z( v4 e3 B% B$ {
<?php
. W$ J* T& r' F4 I0 ]break; } ?>6 Z3 ~- P9 P( M* u3 q
* p f; Z! a Y' m1 P
<?php } ?>2 I$ ]' Y5 g. T
8 |; V) v5 Z9 {) D& N<p class="save-p">8 K8 _5 a" ^5 g( |/ F& h# m7 S9 ?
<input name="save" type="submit" class="sbutton" value="Save Options" /> D* ?( J$ `% ` L
<input type="hidden" name="action" value="save" />4 m2 D9 l' _% h3 W! x; `
</p>7 B5 e( a5 M0 o5 o4 v4 v
</form>4 Y' Q# ]& c& j- j
! p' N, |$ D6 U6 x- `$ x
<form method="post">
, r9 e! `; m+ r* O, [2 t- v' `) {<p class="save-p">3 ^ K! l, n" k9 _6 K
<input name="reset" type="submit" class="sbutton" value="Reset Options" />% ^% ]0 Y, K' _/ @+ y% e
<input type="hidden" name="action" value="reset" />
8 Q2 [( K& L- T; e</p>9 Z |: j+ @- d
</form>
. c; c$ k! ]$ l) J# }3 O" M7 }0 _* v* w- u. \) ^
</div><!-- ADMIN OPTIONS END --># l0 J2 w# ^7 w0 n o& J
$ c" V+ i$ }( `8 u
<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }
& H* K) j* O% p7 Y
1 T9 ~% t% p1 s4 Wfunction mytheme_admin_register() {
: K0 E$ I( a8 s: u# `5 Z# I9 Tglobal $themename, $shortname, $options;
/ X6 D3 ]* O4 p" nif ( $_GET['page'] == basename(__FILE__) ) {
# l: l4 K1 B* u+ Eif ( 'save' == $_REQUEST['action'] ) {; Z7 Z2 P. Z8 J$ v4 b% T* _
foreach ($options as $value) {2 U6 v g5 C+ i1 E( Q6 P
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
0 k* G. s2 y" Z7 u" P2 `foreach ($options as $value) {
) @. w& {; I, o5 Oif( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
, A' z+ ^( E1 ], Y; T: l# y( zheader("Location: themes.php?page=functions.php&saved=true");
+ }; {- G' w0 y Y tdie;/ A, x* l) r! r4 S: Q
} else if( 'reset' == $_REQUEST['action'] ) {
; p% b0 m, m4 Vforeach ($options as $value) {9 ^! n* U7 F1 b7 f0 o* l7 {
delete_option( $value['id'] ); }
$ o) B# t9 l, r7 e$ Hheader("Location: themes.php?page=functions.php&reset=true");
' ]; i: o" Y, v; v# a: }* E4 ~3 Pdie;
! G4 h- c: j" Q: J z0 F5 t( `9 G8 {}/ ~9 `' b! X$ s: w. Q
}
' K/ C* l) ]# Jadd_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
; v9 Z1 @* k2 }, H; p6 h& {}/ L3 K2 H4 I& v, Q6 [) b
! I5 k' `' U" w" U9 A
function mytheme_admin_head() { ?>; l% q {, b; m3 q/ H
<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />
) R( t3 u7 E$ d* d<?php }( ~$ c' l2 }. t; Y9 G8 Q2 ?2 d
|
|