|
|

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