|
|

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