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