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