|
|

楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////8 J8 ~# z6 q$ G/ E4 m! {
// Theme Option; y$ c2 S! a9 G
////////////////////////////////////////////////////////////////////////////////9 w6 s$ w' J0 L3 w
; u9 Z. U4 Y9 `7 N) M! ]
$themename = "Zenx";
* L& b9 `) D3 g" U$shortname = str_replace(' ', '_', strtolower($themename));
. w* I U' F: @: P/ t3 H" F# {; g' _6 f! o
function get_theme_option($option)
& T+ M( I; d& W% P9 a{
# g7 y4 R# }" J% o1 m: j global $shortname;
; m1 p6 @4 J7 F$ d: s5 C0 q/ Z5 }. C return stripslashes(get_option($shortname . '_' . $option));& L* S" M% `7 _' e
}: O1 |. o, r7 Q/ ~# Y7 o0 q; n$ H
! \. D# ~' e* a0 i
function get_theme_settings($option)
! d+ h: ]1 T7 g5 P/ J( y' N{% [7 L# }5 ]' C6 [" Y- d: `) s
return stripslashes(get_option($option));
5 D6 i% H) O6 }3 V}/ V' N* Z6 R% v; B$ Z
$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");
) _2 T9 R& P+ i) [ P, N* Y$wp_getcat = array();" o. d# c8 [2 n; I* e/ E
foreach ($wp_dropdown_rd_admin as $category_list) {
5 p5 P! `1 \: b/ B/ [6 l$wp_getcat[$category_list->term_id] = $category_list->name;
7 B/ T* h$ j1 q: ?* U- B}/ H* v0 g" u x9 m$ T
$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
" g0 h* |/ p! Y) b& F; a$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");+ y2 Z' J+ X4 e9 C1 E
$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");
k. Q9 P- w& p5 n' e/ W+ \ k& ?% h4 [# J
$options = array ($ G% `. ]/ ?; ~. j4 ` t3 b6 X: j
7 g6 z8 r# H( ^$ H0 y H9 ]1 t
6 `& j! A5 ?+ x- k4 N0 ? array( "name" => "Blog Header Settings",* `# Y' L( ^( S, o, t! o1 m: f5 k
"type" => "heading",0 r2 W W+ ~$ m, L: M! g# w% c
),( @2 G, o3 \6 @0 K
" d3 h8 l6 J2 @+ ]! m; \0 F array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",. G, [. t2 M6 `& m X, s) h8 b
"id" => $shortname."_header_logo_activate",
9 I) V. W, f$ \' \( F "type" => "select",
' @4 Q0 \9 g6 @0 w9 n& X "std" => "No",; G) q6 H) U& q8 k& j) ?$ I- N. y
"options" => array("No", "Yes")),
8 P2 P! t. T5 ~5 Y4 F: Q+ I7 l' C
z L+ y# H T! l! p- Q array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",. Y' ^4 C9 L' w4 G* [
"id" => $shortname."_logo_url",2 `& v6 U% ^0 f" G. T8 `$ N
"type" => "text",
/ {* v/ x/ o, Y+ x& ^ "box" => "social",5 }3 k# A: W/ G. v! I) }! I/ o4 L
"std" => "",
) }# ?5 h. e2 j- X0 s ),* ?& Q& Z) i- B' O; t
b! u% ^4 O/ }+ _2 {/ s* r array( "name" => "Insert Header Banner HTML Code (Header)
% Y& p! M* [; O' { <br /><em>*Recommended Size 468 x 60</em>9 ?! o6 m3 ]9 ^* U; Q, G1 p1 Q
<br /><em>*leave blank if not use</em>",
, i4 g* t4 Z0 j, B: W* | "id" => $shortname."_header_banner",
+ A' b' o9 |# |" g) U P2 A* x8 }6 a "type" => "textarea",
/ |- U& W7 g+ ?# y "std" => "",
7 @; y6 ^" _1 G ),
" G: n2 \1 n; |- i, H2 W F5 v4 z# @% H
array( "name" => "</div></div>",# p' ]; o& m+ X, u9 i
"type" => "close",
1 |. r. l% P2 T8 s! T( G ),, o1 p; f0 m, |- ?/ U
3 ^5 B0 \0 e# V/ P
+ X% ?& \4 ~4 }0 E) `/ E1 A7 y4 Q$ @
array( "name" => "Header Navigation Settings",
/ X, d# r" [( z8 j "type" => "heading",
9 i% q( ?9 t8 o& `; g- o ),( L- ?( P" W( f# a; J
' ?9 o1 u4 w% \" K( F7 A- \ array( "name" => "Insert Page ID To Exclude On Header Navigation<br />$ S% n3 F" o9 W9 a6 l
<em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
# x6 v+ {+ _7 ?& d, u' a <em>*Enter the page post ID number only</em><br />
" l6 \( b/ z7 \ D. u# C7 E <em>*separate by comma</em><br />
, y+ l7 E+ j* W; P <em>*Exclude pages which you don't want to show on the header navigation</em>",
1 j& [7 G4 d( A5 A& z "id" => $shortname."_header_page_navigation",
# I6 F# ?) j" o/ _: T "type" => "text",+ V2 q% w: M' R- G; `
"std" => "",0 G, J- ?" ?& o5 G; d; c( n
),
5 ]0 B! D6 A8 L/ |3 s
1 L. ^% a4 {" [ array( "name" => "</div></div>",& e6 K8 G0 W; e" \; H0 s
"type" => "close",
0 D% U5 \) A* B& H6 } ),9 G* b c" ~5 S) k" Z
# N C G3 |3 K) t8 h1 q8 K7 q
4 q3 [- |$ {4 G( a' L x array( "name" => "Post Auto Thumbnails Settings",
f3 N0 Z7 T) L2 Z# e& a& h "type" => "heading",6 s9 p/ L6 \, b5 G s/ o9 V; ~% t" ^* V
),% U6 ` n- s& U7 U8 ~
, @. o* m, M9 h
array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",+ c% Z7 X! y# |6 _2 O
"id" => $shortname."_timthumb_activate",) w9 O8 D/ M. Z/ a
"type" => "select",
# G+ k6 |5 p% v/ z5 v "std" => "No",
: q, U' S: n0 Z8 X4 | "options" => array("No", "Yes")),
. W! i I9 o, L# p
8 W' h3 b7 O+ x( y3 b array( "name" => "If Timthumb is enabled, Please choose its cropping method",. E. e0 o- H) x9 _) ^
"id" => $shortname."_timthumb_cropping",
5 W- h! u+ i5 c3 O% k3 ]: h "type" => "select",. _% }8 m5 \+ r+ F
"std" => "",8 T S, c+ S) Q7 W: @
"options" => $crop_position),
1 y. C/ z7 H" e
8 z- A; f, @& s# o array( "name" => "Insert Width Of Thumbnail Image<br />
/ j. A b1 C3 `$ m1 A <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />' ]7 W; R! t% t9 r# J
<em>*Leave Blank To Use Default: 250</em><br />",
% R0 Z7 ?' [8 I: F( H3 _7 D "id" => $shortname."_thumb_width",
& s8 j" C( Y. |# m0 L "type" => "text",& D. ] v, ?( l2 c H
"std" => "",4 M7 |- a1 H$ B
),
9 T9 }- o! U* h6 f- j. J+ {
3 H( R$ }- u8 q. [& o9 V2 a6 N array( "name" => "Insert Height Of Thumbnail Image<br />+ T: r; Y3 ^! E. s8 ^1 W
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
3 E) B( F2 l7 Y/ m7 J _ <em>*Leave Blank To Use Default: 200</em><br />",
' y1 H5 j0 Z0 f& @0 y "id" => $shortname."_thumb_height",& L1 A! v0 j$ r" ^ f
"type" => "text",
: _+ h. x# L8 }8 d s" f& [ "std" => "",0 F" o; ?* t7 w( {' e
),. }! n: l7 d# v/ n
8 a+ v2 t3 Z- C+ j8 K2 r+ h array( "name" => "</div></div>",6 R( Z* x6 M' u8 X/ Z' _! W' z* b' e
"type" => "close",2 D/ ?4 K2 ^ W& |8 `
)," {5 _, M- d! ?* }
9 @8 }7 Q7 a/ l1 Z' i
array( "name" => "Featured Content Slider Settings",3 H. I, Y/ C3 r# L8 C: h
"type" => "heading",; f1 y! w* Q8 I
),
) `2 e( q+ E, t* N
" q1 Z0 J1 v* ]' \) L, N) d+ o array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",& N$ U' s; L0 d' k9 C; _( \
"id" => $shortname."_featured_activate",
) a( U6 D* k% d2 l# R4 W1 ` "type" => "select",
& I$ t$ j) d7 g; _ "std" => "No",+ c4 s* o$ F$ B& g. l6 v
"options" => array("No", "Yes")),
( M! o( Q) t9 K: ]( ~
z1 n9 s" A# l( n+ ?& n6 w8 t2 P+ K ~9 [8 R
array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
- z. ~. N; j3 C; {) E5 d "id" => $shortname."_featured_category",
Q& m- P6 h% s8 M8 G" C% ^7 V "type" => "select",9 G6 N L2 \( _7 N- d# a( I* v8 S: j
"std" => "Choose a category:",% S8 d7 N; k: E
"options" => $wp_getcat),
4 o0 m. o8 b' N2 m( N( I" Q
5 k f" A0 m9 j; V" Q/ j array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",. E9 }8 N6 j1 f# a% \2 j/ G) P- R" D
"id" => $shortname."_featured_number",
; n9 q. I& _/ O$ @ "type" => "select",1 {! f2 z4 y$ G3 c
"std" => "Number of post:",
3 }$ T6 B; `$ _2 L# P "options" => $number_entries),) F9 y: @. L" v. V, ]
, M. h" M5 F' U, k `
array( "name" => "</div></div>",
5 ^; D" C) @! O) m3 i "type" => "close",* v$ P2 d3 z9 N7 F3 L# K
),
; z) W( i$ w" n! T1 T. g , Q; v: D8 V4 _4 a- _
array( "name" => "Featured Category Settings",- q5 q" w( b8 O8 s5 M/ ]1 t+ T
"type" => "heading",' \: O! Z) Q! H8 f
),
. F9 n5 Z+ y9 @ B3 `; U! w( O) o& S+ |/ a; o
array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",! k" w2 v* Q, O" A" k$ u4 l/ F
"id" => $shortname."_featured_category_activate",; ~8 }( b/ [; F
"type" => "select",5 W' k3 i" @! s0 @7 Q
"std" => "No",
- A: C2 `) B% ~ "options" => array("No", "Yes")),2 k" i E$ g0 `% t
$ d) l& w8 |) U+ V8 P, l- w! g/ D1 H array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
+ s' D3 S2 m5 u- M& j4 _ "id" => $shortname."_featured_category_id1",
$ Y' x! D/ t: A/ U% B "type" => "select",
4 i6 L# U2 j6 }; y2 W "std" => "Choose a category:",# P5 I5 e4 c) y- a
"options" => $wp_getcat),# A( @4 w6 G; r% {/ h; x8 J
$ r R$ Z6 b$ Q6 a" y# K array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",
5 ~+ \5 h% P' k, Q" ?8 D "id" => $shortname."_featured_number1",5 b9 g) ]% z+ T! z- D
"type" => "select",
4 b4 i& Q8 X3 h: ]- e2 N "std" => "Number of post:",/ P X1 {/ I* k3 ^$ w( ~7 q3 }% s
"options" => $number_entries),
% v# P3 f4 r2 z4 z3 S ! Y. h! l' X7 d, d
array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
; f2 O# u# a* ]: C "id" => $shortname."_featured_category_id2",
+ e9 ?- o9 s9 K$ ~. a. ^) C "type" => "select",
6 y( e2 |) r% ^ "std" => "Choose a category:",$ m$ [2 [- x% z' w$ B5 Y8 V3 F
"options" => $wp_getcat),5 T4 F* A7 o" E4 u6 b+ o5 v1 N
9 o6 `, a' {; V+ L
array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>", T/ S. H5 t: o* q
"id" => $shortname."_featured_number2",
# o8 y+ O# r4 k+ F/ {7 A" Z4 @ "type" => "select",
# l2 L; M: u, r" ], [6 z! ~6 i "std" => "Number of post:",
2 r6 l2 d _; u9 j5 W. @$ E "options" => $number_entries),
8 p7 o) M' s' F3 v6 _9 U5 l
" o. L0 R# \, L
6 m% D( p3 b1 J* r8 D array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
- m, E6 ?4 @+ W: S9 Q: b+ ^ "id" => $shortname."_featured_category_id3",/ N- ~$ G: z6 x0 e
"type" => "select",5 O* F6 L/ N6 r( K" C& Q, I
"std" => "Choose a category:",
* z: k% T3 v/ ` "options" => $wp_getcat),
. t% j/ R3 m1 w6 @' u; E. U; j: P # F( s2 ]8 E; e1 o; i( v
array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
7 ~+ H4 i7 }/ h3 r+ H) t! x "id" => $shortname."_featured_number3",
8 g' ^" Q( z& z- r+ G& ^$ h. [ "type" => "select",- L" I& V5 j% G
"std" => "Number of post:",
/ v/ h: g z8 q% i7 f6 S* V "options" => $number_entries),
4 b. I6 g% D- k3 V; r' _4 [$ L z$ F
. y \1 a$ a" G3 ` array( "name" => "</div></div>",/ c9 U; S u6 R; x7 M/ z
"type" => "close",
- \: K; t2 x5 h* F3 \4 }( [ ),
6 V: @0 d7 C! P8 Z$ \5 G- x$ ], {3 P0 B8 d, l" l- i
' M5 }" ~* }; g3 z+ x( S
array( "name" => "Google Adsense & Analytics Settings",
; S+ L* m. @4 @6 d0 |6 d# _ "type" => "heading",4 b8 }1 L# I, ?! r
),
9 c# c6 o* f; P m
6 w% Q' S l* O array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",: N4 ?! m" V: L1 v! B
"id" => $shortname."_adsense_loop_activate",
+ B5 S1 _% F' c u- r1 R "type" => "select",- G3 _ @3 D; Z. r5 w
"std" => "Disable",! i4 j- M- I; P9 U
"options" => array("Disable", "Enable")),5 |9 m- x% m" F, K. g2 i/ b; J
/ S* t5 P1 X# U/ M
array( "name" => "Insert Google Adsense Code For Loops Here<br />
7 c: v) Q) M, a6 p2 o <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",8 Q: y1 p! i! T. P0 t+ B
"id" => $shortname."_adsense_loop",
0 y S* \2 g+ v$ d0 l "type" => "textarea",# b0 a; X+ y$ d( @; I
"std" => "",- b6 u) v! n% { C0 n. q% Z
),4 N: e2 Q% t* N# ^
& C' `# q' a2 y1 u, w array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",
0 Z8 D p) {+ v0 u/ ?5 _/ n "id" => $shortname."_adsense_single_activate",
1 ~* k# G/ C' K+ F/ y0 e; u% x; H "type" => "select",
* D' [7 R, o" a7 L6 J "std" => "Disable",
; N; K# A$ P9 X "options" => array("Disable", "Enable")),
# T4 B! ~* _) P2 r2 u- Z1 p8 `3 h' u* S' P2 e/ U1 G( }, g: A
array( "name" => "Insert Google Adsense Code For Single Page Here<br /># |0 |7 u8 a) d$ p
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>"," ?, a7 F; p. {3 z# Q& P
"id" => $shortname."_adsense_single",
- q5 ]+ s$ C' V "type" => "textarea",
/ n2 `' \9 o5 P' S' {4 n1 j "std" => "",6 o8 |! v0 l) A$ s5 @/ w3 N& b
),
2 c; A0 t% \) G: K1 i) X' Y- t; C. C3 j6 h' z6 A4 @
2 O* l6 X5 `+ m5 m! c array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
! E0 V$ v" {" a$ z7 A+ p' u/ n "id" => $shortname."_google_analytics",0 K* q- v0 v$ k9 Z$ n
"type" => "textarea",
1 P" w/ z m# r" R- f8 y( a "std" => "",& Y8 G4 P( t& Y8 M* |' A
),
; a4 \& O3 }. ~+ a, l5 J. _5 ]! N0 _8 X. v5 a
array( "name" => "</div></div>",3 O. ~& n0 a7 X% v# D. `8 ~
"type" => "close",
3 i% {" a7 b: G* i ),3 ^" Z+ P. V) H$ }; A: P7 q7 G2 ^
" a& [/ Z- k4 m0 J
" t* I9 T$ Z9 h5 O) w5 g; l array( "name" => "AddThis Social Bookmarking Settings",5 h! v& l: @0 v# t" X8 |
"type" => "heading",% {6 o4 d' }- q- N
),: W7 o$ ?2 d: E5 W) f) p
4 v3 b. u+ p- V! G( P% y: S array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>8 {' g B m* q$ W, N
<br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",% R6 a/ [- t/ @- h
"id" => $shortname."_addthis",5 D0 ]5 a$ w9 N; @
"type" => "text",
# F5 Z$ J0 w" L8 _) r/ X "box" => "social",
, l; e; P( t" r% x8 z "std" => "",
3 T2 C) O$ e( D# l8 I; @ ),9 l5 [( l) m1 [. q
0 h# I% `1 B1 F- h
array( "name" => "</div></div>",
& |/ C, R5 ^" c% e) [% U1 L' t# V "type" => "close",$ p, j! s1 ]3 v! u' e
),
$ ^! h" M' \5 _& x! `5 S& k7 E
p7 S2 H$ Z$ g# K8 E1 c3 }5 s
6 q/ o) r3 x) ?1 ~ & f) O; j2 _+ t- \3 q4 v; j* X
array( "name" => "YouTube Video Settings"," G6 _1 m6 Z$ _/ b
"type" => "heading",. X# f6 k7 u- a/ N+ e0 ]4 l
),# f& E- N4 J, E: j
1 H+ Q- J; Y% q! o3 C array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
7 G* a' Q- E4 n) K% y! S4 v% n "id" => $shortname."_emvideo_activate",
. ~5 t$ v; g, p "type" => "select",+ Z# Y3 a# @6 m6 p
"std" => "No",
/ q+ N- y9 q7 V. ?, j "options" => array("No", "Yes")),
; q$ _8 f; d7 Q0 T" r* K, y, M. \5 X: @
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>",
0 A& ~. h3 f! |5 {! q "id" => $shortname."_emvideo",) d* q! c2 H$ }3 n
"std" => "",( w, M: `1 a& R4 t
"type" => "text"),
1 S; S8 [* Z# Q: B- C+ M. B2 t4 S& \, @) B* N% i( A
array( "name" => "</div></div>",
5 _$ D" E" I! C# ?2 h' [! t "type" => "close",) w$ m+ D# _! @/ |2 C% W$ G2 p; V
),
0 j9 k- L) R3 C4 D3 u5 f" k) D * [4 L2 M, p. M4 I% q
array( "name" => "Twitter Settings"," F/ B9 E1 q0 b a
"type" => "heading",7 V3 m! D& g8 Z3 H0 @% Z
),
: w* B: s6 s- Y' K/ B. V; b; j+ p6 h8 ~* ~
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
) X6 b) A2 f" M) `9 a- C" J& w "id" => $shortname."_twitter_activate",+ C- w0 T2 R1 f+ a) S# ~
"type" => "select",( k, Y6 q7 H) P y. q2 c2 e
"std" => "No",8 T5 q% c3 h1 H1 p" x
"options" => array("No", "Yes")),: J/ x) g. Y2 Q- l0 z
4 z2 }& ]( x u+ h array( "name" => "Insert Your Twitter ID here! x0 o" \. w+ o2 g( z% J
<br /><em>*leave blank if not necessary</em>' [% J6 {! i' ~6 u' B
<br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",
) U* C; A0 ~, O. V' Z "id" => $shortname."_twitter",
+ C2 Q3 q+ X: M# l "type" => "text",9 `$ J* x! r$ J! S
"box" => "social",% m, L e5 G2 C; v# N
"std" => "",* q, H; J7 N6 O. u/ `
),- y( [5 J- |* v$ R
# m$ p' o2 c7 ^2 V0 _, E. s
array( "name" => "Enter Twitter Feed Count here
3 I0 i+ j( w8 \ <br /><em>*leave blank if not necessary</em>
# X" g+ q0 s* y <br /><em>*Enter How Many Twitter Feed To Display</em>",
; }6 a0 w; W* T$ J# \" z9 H "id" => $shortname."_twitter_count",
4 m9 ], v" p) h7 ~8 O- k "type" => "text",
! s$ B- W9 b# q& Y5 |2 b! r "box" => "social",/ [/ X; o! p9 C1 I3 q' m
"std" => "",1 T; O' b z+ E7 Y+ b1 M
),
; ~+ z6 Z! s- B7 O- o3 Z
- ~% v8 S& P. \2 g+ n array( "name" => "</div></div>",
5 ^0 ?5 ]$ x* s: R "type" => "close",
7 R/ e. Y# _4 R6 N5 v" y ),
6 B! I0 e; R& Y9 x/ T# ]; R, ~
; u( q& p) {7 c% o; T. z
: M1 I& q& M: m* F0 y array( "name" => "125 x 125 Banners Advertisement Settings",& n4 `# w( C9 M O2 g2 t
"type" => "heading",
; ?7 }# m* S4 w. S, C: y ),
: M; T- n+ w. m9 ~. C9 s
# D8 u% D. V! r$ R. s5 d/ v array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",3 E, ^$ i k& w p Y
"id" => $shortname."_sponsor_activate",
' u( F4 S: b2 B "type" => "select",' p3 e1 b' E, O3 C8 e
"std" => "No",
+ R0 \) K$ n* p) R( k; [9 U! B+ { "options" => array("No", "Yes")), d% X0 N3 I, ]5 d
* V1 J; A+ H# x8 t4 z9 Z" e$ c1 v9 N. \/ h/ |. @$ W
array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",1 v* T1 X* K0 w9 r" g. X7 B' J
"id" => $shortname."_sponsor_banner_one",9 y: F4 A6 o. Z0 t5 }+ R
"type" => "textarea",
- ^) A( `% y) j; b$ @7 Z* V& D5 s "std" => "",& y+ q* s: p% ?+ g, X: ]9 M
), 1 ?% k: i1 d$ [
) |: t& v/ p5 ~& S' `6 L/ Y* F array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",% n1 ?' i+ J, F2 p b- w
"id" => $shortname."_sponsor_banner_two",
: W3 \& t) I2 D. s$ V+ P( Y% I; r- q X "type" => "textarea",
6 F0 e: j# [( O2 [0 W "std" => "",
& X9 I4 f0 g6 S& ?5 `+ J ),- m& t# Z J& N; i$ l( ]
, I. b3 Q$ v. `# x
array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
4 s1 g9 ~) N5 W "id" => $shortname."_sponsor_banner_three",
: W. Z- u: |& z1 z! | "type" => "textarea",
- r4 C7 y3 g* X$ K' \/ s1 }, f "std" => "",' `) x. l) Q& t
),9 _* u6 D& v' B
. r' I) }9 Z2 D$ R h1 d7 K9 c# L3 T array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
# u4 f" r. V9 K1 {( { "id" => $shortname."_sponsor_banner_four",
3 r" c4 l& {8 s "type" => "textarea",( p& z: ] D$ k) r' T: g
"std" => "",
6 \! A: t$ R: V. x2 J ),
0 d) Q6 i9 }7 O, w
' L% O% [3 z, e4 O2 y2 Q array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",& y- |5 e4 R7 u, h K) C9 V
"id" => $shortname."_sponsor_banner_five",
5 S$ {/ r+ ^# k8 G- v- q* Y4 S8 w1 l "type" => "textarea",
9 s/ @, X( G! y# c "std" => "",# l ?$ v5 ]4 A' b' _8 O
),
* M" F& p2 d* H; E9 W2 G6 w
8 @! b0 r1 o$ ^8 z. [2 d array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",% l k9 W2 O" w% P' c
"id" => $shortname."_sponsor_banner_six",
# P' J, B0 X1 P2 d* b0 l, ? "type" => "textarea",0 q7 t0 ]; @8 j2 s2 l2 |/ a
"std" => "",, D, N9 Y2 y, N8 [. l
),
2 N$ ?. L3 w( o7 e$ N3 U
4 _8 q0 S& Y2 ] array( "name" => "</div></div>",
- |) G4 [ l7 Y2 l% s( V "type" => "close",
& K" g5 G/ C* C0 j; _0 t L& E ),; K$ l9 o0 |& l' O; D- t* ?
# f9 H: z$ ?" c5 r/ |) v0 _
: M5 z6 A1 |( c+ N& P S9 [8 {
8 Q/ a* x8 q4 y8 S; N5 Y);0 P0 I& E( M. s( V% Q+ x; g9 O. T
5 |+ Z% U' I1 h8 r" p4 Pfunction mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {+ p4 T, j, O1 i3 \% w% h6 u. a
7 I3 U* k5 N) E
echo "<div id=\"admin-options\"> ";
: d9 {; G2 I: O% [2 Y- v, V! Z6 |
) w1 b( z7 e8 y/ R2 }$ cglobal $themename, $shortname, $options;; `! C& M+ |+ m/ l# G1 [
if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';
6 X3 i9 J2 s: }* ^5 Aif ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';
+ d+ v. r2 h R$ Y+ ~+ l?>7 g+ f0 \" j4 V, x+ U
% Y$ j) l/ m, F. c& X1 }9 Y* T<h4><?php echo "$themename"; ?> Theme Options</h4>% x8 n8 L6 V4 x# b" n |
+ I/ m0 C8 g4 g+ M7 ~
<div class="annouce">
3 L8 z% V v1 z% m' A9 [<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>5 p+ N! W1 f( s+ w& q$ c
<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>
. x7 L i; n* u1 ?6 X' c6 Z</div>9 B* U8 ]- B; ^; o: ~6 u
$ F# X8 n. y5 |9 [4 o<form action="" method="post">
/ R% F3 X) Q) U6 f* Q0 T1 b( v# I8 s `
* l" e+ P& t* d# r4 r<?php foreach ($options as $value) { ?>
1 X' U6 o8 F+ S. l% C
- B9 D+ z8 C8 |! l! g<?php switch ( $value['type'] ) { case 'heading': ?>
. m! q* \. S! i( Z. x! j# ]& |0 q* A! y' o9 n
<div class="get-option">+ I8 }2 r/ L4 }- z% r7 w
! l: k. j* J& B' x% ^<h2><?php echo $value['name']; ?></h2>) W% L) E. e5 g
3 h% [2 n8 `/ E7 f2 r* o
<div class="option-save">$ I! t3 N* _8 F* ^% r! Q( e
! u1 T+ G# \( w% H& F6 T1 R<?php
l- C! s: e$ j& ~0 i0 }& ^7 T/ f+ s0 |break;
& D2 r6 b% V3 g% Icase 'text':; l3 D. D N' `% ^
?>1 S8 |- o7 b4 E& v9 X( q
* f% X7 \; w/ G# b1 R$ R* V1 K* k9 N<div class="description"><?php echo $value['name']; ?></div>% ], e+ P' i- a3 @3 B0 T m }$ W
<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (, v; X y3 \ H1 {2 w6 h
" P2 q& z- W' \% C6 l! A5 m6 bget_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>$ ~' q7 l. l, D* D _' t- a
' p# M1 O s& n& \<?php* Z/ [* y) O( x1 b& L% y! C
break;
3 t% L: @; J& w( H: Pcase 'select':* B+ l2 w- E' ?2 _4 A) s; @/ p- d
?>; u) a- D( R0 ]- a" `& F
) T, O# U% J2 X
<div class="description"><?php echo $value['name']; ?></div>
8 f& n* z( T1 _, X<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">
3 H/ J% d" M3 e: T/ G3 X# G<?php foreach ($value['options'] as $option) { ?>' P/ L: d* q! z$ N$ `# g
<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>4 v7 t# c5 P# Y9 e! o
<?php } ?>3 P5 V; d5 c, a; X5 P/ h
</select>. C* o. P9 f, t" ?4 k* a& z( }
</p>0 d e9 ?, P* [
. D& d1 A* z+ r* q' e' P
<?php% V4 T x7 t& G8 {
break;4 Z6 C4 K- h4 j7 v1 ^8 x7 I
case 'textarea':' U& M, H% ^ {7 [, r8 u
$valuex = $value['id'];' A1 J. E! m9 W; a+ I
$valuey = stripslashes($valuex);
5 J) \% `5 O( `4 X* v5 m& c8 g$ _$video_code = get_settings($valuey);) M. ~% k* f" x' W0 j4 T
?>; ]% x6 D+ Y% Y# u! D
7 N1 }" d7 J9 y# d' p<div class="description"><?php echo $value['name']; ?></div>
: v& i3 x3 H B. ~$ p( c. M* U<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
4 P$ @* ^+ e( `7 D/ h! c2 p
$ X8 G* h# D, x7 s5 v: a6 f2 j5 n. [5 h5 welse { echo $value['std']; } ?></textarea></p>
% I. g! E% r) n4 Q8 r
: ]6 j( U9 J7 u8 l& b9 G6 O- [7 u<?php1 c" x9 y$ \6 m- R5 ?; r
break;9 X5 A1 j- z& q m# b8 D* n3 H
case 'close':
: Z @% T2 U, j) K% o U6 {?>) [, A6 A1 ]( V% U" L: H5 M
# e5 Y9 F3 o/ P% ?3 x<div class="clearfix"></div>9 Q6 {9 h! e9 p+ l5 n
</div><!-- OPTION SAVE END -->. s* Y4 m/ b! J' z6 Y! \! _# T! c
) t0 y _% p6 o
<div class="clearfix"></div>) _: v# L' q6 ?0 h
</div><!-- GET OPTION END -->
+ r2 X1 F& [" v; i
/ e: A3 k# H: ]$ q' k& Z8 T3 q<?php
2 g5 B& m5 U4 @break;
' E8 t9 V% i; m& |9 ddefault;3 u' Y7 [# z$ L
?>. V: ^* c# i; t. `) S
4 N. B% M4 }. g, c. o& Y2 u
4 M4 ?4 ]5 `( R" f9 F<?php
/ F7 I3 Y" x8 \' L8 ^; I: ~5 Zbreak; } ?>- S& _$ h: c! V4 X! W
! h% F. p$ |1 g/ a2 T/ u; J<?php } ?>: F3 x# h9 R2 ~* F
% g' R8 s% g' v2 I! i* j/ X
<p class="save-p">& S/ S* ~- c% \; R
<input name="save" type="submit" class="sbutton" value="Save Options" />' O; @5 O$ h" L' P' A' n
<input type="hidden" name="action" value="save" /># M8 b! S2 M7 k+ U8 Y
</p>- Q# O) w9 R# m4 ~+ E% z7 ^
</form>9 h _/ J! x+ l2 h4 ^
5 }; q) k4 ~3 q: J6 K<form method="post">
7 B7 K; {) P6 |! D, E- X6 g8 m<p class="save-p">
, W3 B( j( h2 S) ^) S<input name="reset" type="submit" class="sbutton" value="Reset Options" />
% i2 \( ^! ]' {) x<input type="hidden" name="action" value="reset" />6 S; z, H# }6 _/ }4 `. r! F ~8 h
</p>
' \+ w. ]% v+ f' [9 H( L+ h$ W</form>
* ?0 L( w: T- l5 X' r4 n) F1 t* S- E3 h f" G
</div><!-- ADMIN OPTIONS END -->$ n* K5 F1 C$ w. q
0 v# F; q1 a8 M7 c0 J
<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }
: g! A* M g0 u4 S+ q/ |. B& ^) L( W/ V2 g
function mytheme_admin_register() {
& i5 `0 E- Q C T* Gglobal $themename, $shortname, $options;% H3 q% f7 V! ^ p
if ( $_GET['page'] == basename(__FILE__) ) {
1 Q) s6 C. A" m" P0 m' C8 ~if ( 'save' == $_REQUEST['action'] ) {0 B! [8 J2 ^+ {+ P% j4 Z& m9 P
foreach ($options as $value) {+ L& ]% |/ w* ^9 V& x* D1 D' }
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }& n. L$ }# n- E. Y2 Q& g- @" K
foreach ($options as $value) {
5 m4 i" Y2 R+ O( t. Q* Kif( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }3 i" H; v/ X4 m2 N! @$ m
header("Location: themes.php?page=functions.php&saved=true");
# B! x- U$ l8 p& _! Sdie;6 k1 x" p1 u0 R7 L0 k# S
} else if( 'reset' == $_REQUEST['action'] ) {
! c& h. y. F+ jforeach ($options as $value) {
. B' n" H$ `6 |- `* I& U& v4 b4 zdelete_option( $value['id'] ); }2 b: k; Y$ d! x) o
header("Location: themes.php?page=functions.php&reset=true");
7 p& A2 r6 g& Z8 [0 N: Mdie;
5 R0 l! C. A, D2 p6 Y+ k9 l}& E: F1 T7 j" O$ l
}
9 W' u' d7 j/ U) a/ p* b+ Z2 ?4 Dadd_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
6 ^4 Y6 o/ }; v}
: _1 C7 f l; J1 d) m) h% u& j2 ^ \3 f, W
function mytheme_admin_head() { ?>
( m F% X1 e% }; v( \. d5 C" V<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />
7 o. H- g2 h) J, f( Y1 i% b { U1 g<?php }8 a% Z; a. f+ H
|
|