|
|

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