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