|
|

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