|
|

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