|

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