|
|

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