|
|

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