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