|

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