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