|
|

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