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