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