|
|

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